From 49bbf7900c87270926197768bd050c7b461a8e55 Mon Sep 17 00:00:00 2001 From: Amidu Oloso Date: Tue, 14 Jan 2025 16:54:53 -0500 Subject: [PATCH 01/12] still trying to fix GOCART2G array indexing --- generic/OpenMP_Support.F90 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/generic/OpenMP_Support.F90 b/generic/OpenMP_Support.F90 index 9cdf0a3ac1c8..661b5b0ace9a 100644 --- a/generic/OpenMP_Support.F90 +++ b/generic/OpenMP_Support.F90 @@ -6,6 +6,7 @@ module MAPL_OpenMP_Support use MAPL_maplgrid use MAPL_ExceptionHandling use mapl_KeywordEnforcerMod + use MAPL_BaseMod, only : MAPL_Grid_Interior !$ use omp_lib implicit none @@ -83,7 +84,7 @@ function make_subgrids_from_bounds(primary_grid, bounds, unusable, rc) result(su type(Interval), intent(in) :: bounds(:) class(KeywordEnforcer), optional, intent(in) :: unusable integer, optional, intent(out) :: rc - integer :: local_count(3) + integer :: local_count(3), global_count(3) integer :: status integer :: petMap(1,1,1) integer :: myPet, section, i, j, k, count, size_ @@ -102,7 +103,7 @@ function make_subgrids_from_bounds(primary_grid, bounds, unusable, rc) result(su !end do allocate(subgrids(size(bounds))) - call MAPL_GridGet(primary_grid,localcellcountPerDim=local_count, _RC) + call MAPL_GridGet(primary_grid,localcellcountPerDim=local_count, globalCellCountPerDim=global_count, _RC) call ESMF_VMGetCurrent(vm, _RC) call ESMF_VMGet(vm, localPET=myPET, _RC) @@ -175,6 +176,23 @@ function make_subgrids_from_bounds(primary_grid, bounds, unusable, rc) result(su itemCount = count, valueList=lons1d, _RC) call ESMF_AttributeSet(subgrids(i), name='GridCornerLats:', & itemCount = count, valueList=lats1d, _RC) + block + integer :: global_grid_info(10) + integer :: i1,i2,j1,j2 + call MAPL_Grid_Interior(primary_grid,i1,i2,j1,j2) + global_grid_info(1:3) = global_count + !global_grid_info(4:6) = local_count + global_grid_info(4) = size(new_lons,1) + global_grid_info(5) = size(new_lons,2) + global_grid_info(6) = local_count(3) + global_grid_info(7) = i1 + global_grid_info(8) = i2 + global_grid_info(9) = j1 + bounds(i)%min - 1 + global_grid_info(10) = j1 + bounds(i)%max - 1 + print '(a,i6,6i4)', __FILE__, __LINE__, myPet, i, j1, j2, global_grid_info(9), global_grid_info(10) + call ESMF_AttributeSet(subgrids(i), name="GLOBAL_GRID_INFO", & + itemCount=10, valueList=global_grid_info, _RC) + end block deallocate(lons1d, lats1d) deallocate(new_corner_lons, new_corner_lats) From ef5e0245d69388c971174b34faab7a66db820958 Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Wed, 15 Jan 2025 11:31:47 -0500 Subject: [PATCH 02/12] more updates --- base/Base/Base_Base_implementation.F90 | 60 ++++++++++++++++++++------ base/MaplGrid.F90 | 9 ++++ 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/base/Base/Base_Base_implementation.F90 b/base/Base/Base_Base_implementation.F90 index b50e84e98897..6653bf2e38fa 100644 --- a/base/Base/Base_Base_implementation.F90 +++ b/base/Base/Base_Base_implementation.F90 @@ -1557,11 +1557,24 @@ module subroutine MAPL_GRID_INTERIOR(GRID,I1,IN,J1,JN) integer :: gridRank integer, allocatable :: localDeToDeMap(:) integer :: rc + logical :: isPresent + integer :: global_grid_info(10) i1=-1 j1=-1 in=-1 jn=-1 + + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", isPresent=isPresent, _RC) + if (isPresent) then + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", valueList=global_grid_info, _RC) + I1 = global_grid_info(7) + IN = global_grid_info(8) + j1 = global_grid_info(9) + JN = global_grid_info(10) + _RETURN(_SUCCESS) + end if + call ESMF_GridGet (GRID, dimCount=gridRank, distGrid=distGrid, _RC) call ESMF_DistGridGet(distGRID, delayout=layout, _RC) call ESMF_DELayoutGet(layout, deCount = nDEs, localDeCount=localDeCount,_RC) @@ -2138,6 +2151,24 @@ module subroutine MAPL_GridGetInterior(GRID,I1,IN,J1,JN) integer :: deId integer :: gridRank integer :: rc + logical :: isPresent + integer :: global_grid_info(10) + + i1=-1 + j1=-1 + in=-1 + jn=-1 + + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", isPresent=isPresent, _RC) + if (isPresent) then + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", valueList=global_grid_info, _RC) + I1 = global_grid_info(7) + IN = global_grid_info(8) + j1 = global_grid_info(9) + JN = global_grid_info(10) + _RETURN(_SUCCESS) + end if + call ESMF_GridGet (GRID, dimCount=gridRank, distGrid=distGrid, _RC) call ESMF_DistGridGet(distGRID, delayout=layout, _RC) @@ -2627,9 +2658,9 @@ module subroutine MAPL_GetHorzIJIndex(npts,II,JJ,lon,lat,lonR8,latR8,Grid, rc) tmp_lats = latR8 end if -!AOO change tusing GridType atribute if (im_world*6==jm_world) then - call ESMF_AttributeGet(grid, name='GridType', value=grid_type, _RC) - if(trim(grid_type) == "Cubed-Sphere") then + if (im_world*6==jm_world) then +! call ESMF_AttributeGet(grid, name='GridType', value=grid_type, _RC) +! if(trim(grid_type) == "Cubed-Sphere") then call MAPL_GetGlobalHorzIJIndex(npts, II, JJ, lon=lon, lat=lat, lonR8=lonR8, latR8=latR8, Grid=Grid, _RC) @@ -2868,28 +2899,33 @@ function grid_is_ok(grid) result(OK) type(ESMF_Grid), intent(inout) :: grid logical :: OK integer :: I1, I2, J1, J2, j - real(ESMF_KIND_R8), pointer :: corner_lons(:,:), corner_lats(:,:) + real(ESMF_KIND_R8), allocatable :: corner_lons(:,:), corner_lats(:,:) real(ESMF_KIND_R8), allocatable :: lonRe(:), latRe(:) real(ESMF_KIND_R8), allocatable :: accurate_lat(:), accurate_lon(:) real(ESMF_KIND_R8) :: stretch_factor, target_lon, target_lat, shift0 real :: tolerance + integer :: local_dims(3) tolerance = epsilon(1.0) call MAPL_GridGetInterior(grid,I1,I2,J1,J2) + call MAPL_GridGet(grid, localCellCountPerDim=local_dims, _RC) OK = .true. ! check the edge of face 1 along longitude - call ESMF_GridGetCoord(grid,localDE=0,coordDim=1,staggerloc=ESMF_STAGGERLOC_CORNER, & - farrayPtr=corner_lons, rc=status) - call ESMF_GridGetCoord(grid,localDE=0,coordDim=2,staggerloc=ESMF_STAGGERLOC_CORNER, & - farrayPtr=corner_lats, rc=status) + !call ESMF_GridGetCoord(grid,localDE=0,coordDim=1,staggerloc=ESMF_STAGGERLOC_CORNER, & + ! farrayPtr=corner_lons, _RC) + !call ESMF_GridGetCoord(grid,localDE=0,coordDim=2,staggerloc=ESMF_STAGGERLOC_CORNER, & + ! farrayPtr=corner_lats, _RC) + allocate(corner_lons(local_dims(1)+1, local_dims(2)+1)) + allocate(corner_lats(local_dims(1)+1, local_dims(2)+1)) + call MAPL_GridGetCorners(grid, corner_lons, corner_lats, _RC) if ( I1 == 1 .and. J1 == 1 ) then - allocate(lonRe(j2-j1+1), latRe(j2-j1+1)) - call MAPL_Reverse_Schmidt(grid, stretched, J2-J1+1, lonR8=corner_lons(1,:), & - latR8=corner_lats(1,:), lonRe=lonRe, latRe=latRe, _RC) + allocate(lonRe(local_dims(2)), latRe(local_dims(2))) + call MAPL_Reverse_Schmidt(grid, stretched, local_dims(2), lonR8=corner_lons(1,1:local_dims(2)), & + latR8=corner_lats(1,1:local_dims(2)), lonRe=lonRe, latRe=latRe, _RC) - allocate(accurate_lon(j2-j1+1), accurate_lat(j2-j1+1)) + allocate(accurate_lon(local_dims(2)), accurate_lat(local_dims(2))) shift0 = shift if (stretched) shift0 = 0 diff --git a/base/MaplGrid.F90 b/base/MaplGrid.F90 index fdac6371357e..153fdd11d865 100644 --- a/base/MaplGrid.F90 +++ b/base/MaplGrid.F90 @@ -265,10 +265,19 @@ subroutine MAPL_GridGet(GRID, globalCellCountPerDim, localCellCountPerDim, layou type(ESMF_DistGrid) :: distGrid integer, allocatable :: maxindex(:,:),minindex(:,:) integer, pointer :: ims(:),jms(:) + integer :: global_grid_info(10) pglobal = present(globalCellCountPerDim) plocal = present(localCellCountPerDim) + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", isPresent=isPresent, _RC) + if (isPresent) then + call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", valueList=global_grid_info, _RC) + if (pglobal) globalCellCountPerDim = global_grid_info(1:3) + if (plocal) localCellCountPerDim = global_grid_info(4:6) + _RETURN(_SUCCESS) + end if + if (pglobal .or. plocal) then call ESMF_GridGet(grid, dimCount=gridRank, _RC) From f7b8f4e7523a280580e60da093d7c44e7d7281ba Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Thu, 16 Jan 2025 17:14:58 -0500 Subject: [PATCH 03/12] fixes #3338 --- Tests/ExtDataRoot_GridComp.F90 | 43 ++++++------------- gridcomps/ExtData2G/ExtDataBracket.F90 | 21 ++++++--- .../ExtData2G/ExtDataSimpleFileHandler.F90 | 6 ++- 3 files changed, 33 insertions(+), 37 deletions(-) diff --git a/Tests/ExtDataRoot_GridComp.F90 b/Tests/ExtDataRoot_GridComp.F90 index 38504a9da6e6..f54db0563138 100644 --- a/Tests/ExtDataRoot_GridComp.F90 +++ b/Tests/ExtDataRoot_GridComp.F90 @@ -677,12 +677,8 @@ subroutine CompareState(State1,State2,tol,rc) integer :: status integer :: i - real, pointer :: ptr3_1(:,:,:) - real, pointer :: ptr3_2(:,:,:) - real, pointer :: ptr2_1(:,:) - real, pointer :: ptr2_2(:,:) - real, pointer :: ptr1_1(:) - real, pointer :: ptr1_2(:) + real, pointer :: ptr1(:) + real, pointer :: ptr2(:) integer :: itemcount,rank1,rank2 character(len=ESMF_MAXSTR), allocatable :: NameList(:) logical, allocatable :: foundDiff(:) @@ -696,6 +692,7 @@ subroutine CompareState(State1,State2,tol,rc) _VERIFY(status) call ESMF_StateGet(State1,itemNameList=NameList,_RC) do i=1,itemCount + write(*,*)'comparing ',trim(nameList(i)) call ESMF_StateGet(State1,trim(nameList(i)),field1,_RC) call ESMF_StateGet(State2,trim(nameList(i)),field2,_RC) call ESMF_FieldGet(field1,rank=rank1,_RC) @@ -706,29 +703,17 @@ subroutine CompareState(State1,State2,tol,rc) exit end if _ASSERT(rank1==rank2,'needs informative message') + call assign_fptr(field1, ptr1, _RC) + call assign_fptr(field2, ptr2, _RC) + write(*,*)'bmaa max ',maxval(ptr1),maxval(ptr2) + _ASSERT(size(ptr1)==size(ptr2),'needs informative message') foundDiff(i)=.false. - if (rank1==1) then - call MAPL_GetPointer(state1,ptr1_1,trim(nameList(i)),_RC) - call MAPL_GetPointer(state2,ptr1_2,trim(nameList(i)),_RC) - if (any((ptr1_1-ptr1_2) > tol)) then - foundDiff(i) = .true. - end if - else if (rank1==2) then - call MAPL_GetPointer(state1,ptr2_1,trim(nameList(i)),_RC) - call MAPL_GetPointer(state2,ptr2_2,trim(nameList(i)),_RC) - if (any((ptr2_1-ptr2_2) > tol)) then - foundDiff(i) = .true. - end if - else if (rank1==3) then - call MAPL_GetPointer(state1,ptr3_1,trim(nameList(i)),_RC) - call MAPL_GetPointer(state2,ptr3_2,trim(nameList(i)),_RC) - if (any((ptr3_1-ptr3_2) > tol)) then - foundDiff(i) = .true. - end if - end if - if (foundDiff(i)) then - _FAIL('found difference when compare state') + if (any(abs(ptr1-ptr2) > tol)) then + foundDiff(i) = .true. end if + !if (foundDiff(i)) then + !_FAIL('found difference when compare state') + !end if enddo _RETURN(ESMF_SUCCESS) @@ -741,10 +726,8 @@ subroutine ForceAllocation(state,rc) integer :: status - real, pointer :: ptr3d(:,:,:) - real, pointer :: ptr2d(:,:) integer :: ii - integer :: itemcount,dims + integer :: itemcount character(len=ESMF_MAXSTR), allocatable :: NameList(:) type (ESMF_StateItem_Flag), allocatable :: itemTypeList(:) type(ESMF_Field) :: Field diff --git a/gridcomps/ExtData2G/ExtDataBracket.F90 b/gridcomps/ExtData2G/ExtDataBracket.F90 index c3d0a1023571..f46ee9273266 100644 --- a/gridcomps/ExtData2G/ExtDataBracket.F90 +++ b/gridcomps/ExtData2G/ExtDataBracket.F90 @@ -188,10 +188,13 @@ subroutine interpolate_to_time(this,field,time,rc) right_node_set = this%right_node%check_if_initialized(_RC) left_node_set = this%left_node%check_if_initialized(_RC) - call this%right_node%get(file=right_file) - call this%left_node%get(file=left_file) - right_node_set = right_file /= file_not_found - left_node_set = left_file /= file_not_found + write(*,*)'bmaa first check ',left_node_set,right_node_set,this%exact + call ESMF_TimePrint(this%left_node%time,options='string',preString='left bracket time: ') + call ESMF_TimePrint(this%right_node%time,options='string',preString='right bracket time: ') + !call this%right_node%get(file=right_file) + !call this%left_node%get(file=left_file) + !right_node_set = right_file /= file_not_found + !left_node_set = left_file /= file_not_found alpha = 0.0 if ( (.not.this%disable_interpolation) .and. (.not.this%intermittent_disable) .and. right_node_set .and. left_node_set) then @@ -206,6 +209,7 @@ subroutine interpolate_to_time(this,field,time,rc) if (left_node_set) then call assign_fptr(this%left_node%field,var1d_left,_RC) end if + write(*,*)'bmaa inter: ',left_node_set, right_node_set,this%new_file_left, this%new_file_right if ( left_node_set .and. (time == this%left_node%time .or. this%disable_interpolation)) then var1d = var1d_left else if (right_node_set .and. (time == this%right_node%time)) then @@ -216,7 +220,10 @@ subroutine interpolate_to_time(this,field,time,rc) elsewhere var1d = mapl_undef endwhere - else + end if + + if (this%exact .and. (.not.(time == this%left_node%time))) then + !write(*,*)'bmaa setting undef' var1d = mapl_undef end if @@ -243,10 +250,14 @@ subroutine swap_node_fields(this,rc) left_created = ESMF_FieldIsCreated(this%left_node%field,_RC) right_created = ESMF_FieldIsCreated(this%right_node%field,_RC) + write(*,*)'bmaa swapping nodes ',left_created,right_created + left_created = ESMF_FieldIsCreated(this%left_node%field,_RC) if (left_created .and. right_created) then call assign_fptr(this%left_node%field,left_ptr,_RC) call assign_fptr(this%right_node%field,right_ptr,_RC) + write(*,*)'bmaa LR before: ',maxval(left_ptr),maxval(right_ptr) left_ptr = right_ptr + write(*,*)'bmaa LR after: ',maxval(left_ptr),maxval(right_ptr) end if _RETURN(_SUCCESS) end subroutine swap_node_fields diff --git a/gridcomps/ExtData2G/ExtDataSimpleFileHandler.F90 b/gridcomps/ExtData2G/ExtDataSimpleFileHandler.F90 index 4af0071f29a1..eb92f37e910f 100644 --- a/gridcomps/ExtData2G/ExtDataSimpleFileHandler.F90 +++ b/gridcomps/ExtData2G/ExtDataSimpleFileHandler.F90 @@ -105,8 +105,10 @@ subroutine get_file_bracket(this, input_time, source_time, bracket, fail_on_miss call bracket%set_node('L',file=current_file,time_index=time_index,time=time,was_set=.true.,_RC) if (in_range .and. (bracket%left_node == bracket%right_node)) then - call bracket%swap_node_fields(_RC) - bracket%new_file_left = .false. + if (.not. (current_file == file_not_found)) then + call bracket%swap_node_fields(_RC) + bracket%new_file_left = .false. + end if else if (time_index == time_not_found ) then call this%get_file(current_file,target_time,-1,allow_missing_file,_RC) From 08bd7473eb848a8f4d92da8730e03421f56fa09f Mon Sep 17 00:00:00 2001 From: Amidu Oloso Date: Fri, 17 Jan 2025 12:09:37 -0500 Subject: [PATCH 04/12] removed unnecessary comments --- base/Base/Base_Base_implementation.F90 | 2 -- generic/OpenMP_Support.F90 | 1 - 2 files changed, 3 deletions(-) diff --git a/base/Base/Base_Base_implementation.F90 b/base/Base/Base_Base_implementation.F90 index 6653bf2e38fa..c04decee1501 100644 --- a/base/Base/Base_Base_implementation.F90 +++ b/base/Base/Base_Base_implementation.F90 @@ -2659,8 +2659,6 @@ module subroutine MAPL_GetHorzIJIndex(npts,II,JJ,lon,lat,lonR8,latR8,Grid, rc) end if if (im_world*6==jm_world) then -! call ESMF_AttributeGet(grid, name='GridType', value=grid_type, _RC) -! if(trim(grid_type) == "Cubed-Sphere") then call MAPL_GetGlobalHorzIJIndex(npts, II, JJ, lon=lon, lat=lat, lonR8=lonR8, latR8=latR8, Grid=Grid, _RC) diff --git a/generic/OpenMP_Support.F90 b/generic/OpenMP_Support.F90 index 661b5b0ace9a..9a9c33b629b1 100644 --- a/generic/OpenMP_Support.F90 +++ b/generic/OpenMP_Support.F90 @@ -189,7 +189,6 @@ function make_subgrids_from_bounds(primary_grid, bounds, unusable, rc) result(su global_grid_info(8) = i2 global_grid_info(9) = j1 + bounds(i)%min - 1 global_grid_info(10) = j1 + bounds(i)%max - 1 - print '(a,i6,6i4)', __FILE__, __LINE__, myPet, i, j1, j2, global_grid_info(9), global_grid_info(10) call ESMF_AttributeSet(subgrids(i), name="GLOBAL_GRID_INFO", & itemCount=10, valueList=global_grid_info, _RC) end block From b94da73fd0bd51f005ff83091210cb5e4aa3198b Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Tue, 21 Jan 2025 11:16:49 -0500 Subject: [PATCH 05/12] more updates --- Tests/ExtDataRoot_GridComp.F90 | 8 +++--- .../test_cases/case37/AGCM1.rc | 22 ++++++++++++++++ .../test_cases/case37/AGCM2.rc | 22 ++++++++++++++++ .../test_cases/case37/AGCM3.rc | 26 +++++++++++++++++++ .../test_cases/case37/CAP.rc | 5 ++++ .../test_cases/case37/CAP1.rc | 8 ++++++ .../test_cases/case37/CAP2.rc | 8 ++++++ .../test_cases/case37/CAP3.rc | 9 +++++++ .../test_cases/case37/ExtData.rc | 12 +++++++++ .../test_cases/case37/HISTORY1.rc | 13 ++++++++++ .../test_cases/case37/HISTORY2.rc | 13 ++++++++++ .../test_cases/case37/HISTORY3.rc | 13 ++++++++++ .../test_cases/case37/README | 1 + .../test_cases/case37/extdata.yaml | 12 +++++++++ .../test_cases/extdata_2g_cases.txt | 1 + gridcomps/ExtData2G/ExtDataBracket.F90 | 10 ------- 16 files changed, 168 insertions(+), 15 deletions(-) create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/AGCM1.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/AGCM2.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/AGCM3.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/CAP.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/CAP1.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/CAP2.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/CAP3.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/ExtData.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY1.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY2.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY3.rc create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/README create mode 100644 Tests/ExtData_Testing_Framework/test_cases/case37/extdata.yaml diff --git a/Tests/ExtDataRoot_GridComp.F90 b/Tests/ExtDataRoot_GridComp.F90 index f54db0563138..7578d4b5f797 100644 --- a/Tests/ExtDataRoot_GridComp.F90 +++ b/Tests/ExtDataRoot_GridComp.F90 @@ -692,7 +692,6 @@ subroutine CompareState(State1,State2,tol,rc) _VERIFY(status) call ESMF_StateGet(State1,itemNameList=NameList,_RC) do i=1,itemCount - write(*,*)'comparing ',trim(nameList(i)) call ESMF_StateGet(State1,trim(nameList(i)),field1,_RC) call ESMF_StateGet(State2,trim(nameList(i)),field2,_RC) call ESMF_FieldGet(field1,rank=rank1,_RC) @@ -705,15 +704,14 @@ subroutine CompareState(State1,State2,tol,rc) _ASSERT(rank1==rank2,'needs informative message') call assign_fptr(field1, ptr1, _RC) call assign_fptr(field2, ptr2, _RC) - write(*,*)'bmaa max ',maxval(ptr1),maxval(ptr2) _ASSERT(size(ptr1)==size(ptr2),'needs informative message') foundDiff(i)=.false. if (any(abs(ptr1-ptr2) > tol)) then foundDiff(i) = .true. end if - !if (foundDiff(i)) then - !_FAIL('found difference when compare state') - !end if + if (foundDiff(i)) then + _FAIL('found difference when compare state') + end if enddo _RETURN(ESMF_SUCCESS) diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM1.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM1.rc new file mode 100644 index 000000000000..89bb19cdc467 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM1.rc @@ -0,0 +1,22 @@ +NX: 1 +NY: 1 + +Root.GRID_TYPE: LatLon +Root.GRIDNAME: DC90x45-PC +Root.LM: 3 +Root.IM_WORLD: 90 +Root.JM_WORLD: 45 +Root.POLE: 'PC' +Root.DATELINE: 'DC' + +RUN_MODE: GenerateExports + +EXPORT_STATE:: +VAR1 , time , days , xy , c +:: + +FILL_DEF:: +VAR1 time +:: + +REF_TIME: 20070927 000000 diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM2.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM2.rc new file mode 100644 index 000000000000..6c9fc5049b44 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM2.rc @@ -0,0 +1,22 @@ +NX: 1 +NY: 1 + +Root.GRID_TYPE: LatLon +Root.GRIDNAME: DC90x45-PC +Root.LM: 3 +Root.IM_WORLD: 90 +Root.JM_WORLD: 90 +Root.POLE: 'PC' +Root.DATELINE: 'DC' + +RUN_MODE: GenerateExports + +EXPORT_STATE:: +VAR1 , time , days , xy , c +:: + +FILL_DEF:: +VAR1 time +:: + +REF_TIME: 20070927 000000 diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM3.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM3.rc new file mode 100644 index 000000000000..82b3c952c396 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/AGCM3.rc @@ -0,0 +1,26 @@ +NX: 1 +NY: 1 + +Root.GRID_TYPE: LatLon +Root.GRIDNAME: DC900x45-PC +Root.LM: 3 +Root.IM_WORLD: 90 +Root.JM_WORLD: 45 +Root.POLE: 'PC' +Root.DATELINE: 'DC' + +RUN_MODE: CompareImports + +IMPORT_STATE:: +VAR1 , time , days , xy , c +:: + +EXPORT_STATE:: +VAR1 , time , days , xy , c +:: + +FILL_DEF:: +VAR1 3.0 +:: + +REF_TIME: 20080101 000000 diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/CAP.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP.rc new file mode 100644 index 000000000000..7cbd02ce9493 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP.rc @@ -0,0 +1,5 @@ +CASES:: +CAP1.rc +CAP2.rc +CAP3.rc +:: diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/CAP1.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP1.rc new file mode 100644 index 000000000000..f1b99b9cab61 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP1.rc @@ -0,0 +1,8 @@ +ROOT_NAME: Root +ROOT_CF: AGCM1.rc +HIST_CF: HISTORY1.rc + +BEG_DATE: 20070926 230000 + +JOB_SGMT: 00000004 000000 +HEARTBEAT_DT: 3600 diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/CAP2.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP2.rc new file mode 100644 index 000000000000..9aca6b5d8f8f --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP2.rc @@ -0,0 +1,8 @@ +ROOT_NAME: Root +ROOT_CF: AGCM2.rc +HIST_CF: HISTORY2.rc + +BEG_DATE: 20071001 210000 + +JOB_SGMT: 00000003 000000 +HEARTBEAT_DT: 3600 diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/CAP3.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP3.rc new file mode 100644 index 000000000000..7c38ccd7fc75 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/CAP3.rc @@ -0,0 +1,9 @@ +ROOT_NAME: Root +ROOT_CF: AGCM3.rc +HIST_CF: HISTORY3.rc + +BEG_DATE: 20070930 000000 + +JOB_SGMT: 00000001 120000 +HEARTBEAT_DT: 3600 + diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/ExtData.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/ExtData.rc new file mode 100644 index 000000000000..1b98d7c432b9 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/ExtData.rc @@ -0,0 +1,12 @@ +#CASE_SENSITIVE_VARIABLE_NAMES: .false. +Ext_AllowExtrap: .false. +Prefetch: .true. +DEBUG_LEVEL: 20 + +PrimaryExports%% +VAR2D NA 2008 N 0 none none VAR2D case1.nc4 +%% + + +DerivedExports%% +%% diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY1.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY1.rc new file mode 100644 index 000000000000..eb8896a731fc --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY1.rc @@ -0,0 +1,13 @@ +GRID_LABELS: +:: + +COLLECTIONS: case1 +:: + + case1.template: '%y4%m2%d2.nc4', + case1.format: 'CFIO', + case1.frequency: 240000, + #case1.duration: 000000, + case1.ref_time: 000000, + case1.fields: 'VAR1', 'Root', + :: diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY2.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY2.rc new file mode 100644 index 000000000000..eb8896a731fc --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY2.rc @@ -0,0 +1,13 @@ +GRID_LABELS: +:: + +COLLECTIONS: case1 +:: + + case1.template: '%y4%m2%d2.nc4', + case1.format: 'CFIO', + case1.frequency: 240000, + #case1.duration: 000000, + case1.ref_time: 000000, + case1.fields: 'VAR1', 'Root', + :: diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY3.rc b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY3.rc new file mode 100644 index 000000000000..720dd45ecd3d --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/HISTORY3.rc @@ -0,0 +1,13 @@ +GRID_LABELS: +:: + +COLLECTIONS: +:: + + case2.template: 'nc4', + case2.format: 'CFIO', + case2.frequency: 240000, + case2.duration: 000000, + case2.ref_time: 000000, + case2.fields: 'VAR2D', 'Root', + :: diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/README b/Tests/ExtData_Testing_Framework/test_cases/case37/README new file mode 100644 index 000000000000..6ea1c769dbad --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/README @@ -0,0 +1 @@ +test multiple datasets where an export uses both with with no extrapolation outside and crosses transition date diff --git a/Tests/ExtData_Testing_Framework/test_cases/case37/extdata.yaml b/Tests/ExtData_Testing_Framework/test_cases/case37/extdata.yaml new file mode 100644 index 000000000000..147776977cc8 --- /dev/null +++ b/Tests/ExtData_Testing_Framework/test_cases/case37/extdata.yaml @@ -0,0 +1,12 @@ +Collections: + fstream1: {template: "case1.%y4%m2%d2.nc4", valid_range: "2007-09-22/2007-09-30"} + fstream2: {template: "case2.%y4%m2%d2.nc4", valid_range: "2007-10-01/2007-10-08"} + +Samplings: + s1: + time_interpolation: False + +Exports: + VAR1: + - {starting: "2007-09-22", variable: VAR1, collection: fstream1, sample: s1, fail_on_missing_file: false} + - {starting: "2007-10-01", variable: VAR1, collection: fstream2, sample: s1, fail_on_missing_file: false} diff --git a/Tests/ExtData_Testing_Framework/test_cases/extdata_2g_cases.txt b/Tests/ExtData_Testing_Framework/test_cases/extdata_2g_cases.txt index b79e4a5c9d29..68a05c4dddd2 100644 --- a/Tests/ExtData_Testing_Framework/test_cases/extdata_2g_cases.txt +++ b/Tests/ExtData_Testing_Framework/test_cases/extdata_2g_cases.txt @@ -34,3 +34,4 @@ case33 case34 case35 case36 +case37 diff --git a/gridcomps/ExtData2G/ExtDataBracket.F90 b/gridcomps/ExtData2G/ExtDataBracket.F90 index f46ee9273266..9fff7624bbb3 100644 --- a/gridcomps/ExtData2G/ExtDataBracket.F90 +++ b/gridcomps/ExtData2G/ExtDataBracket.F90 @@ -188,13 +188,8 @@ subroutine interpolate_to_time(this,field,time,rc) right_node_set = this%right_node%check_if_initialized(_RC) left_node_set = this%left_node%check_if_initialized(_RC) - write(*,*)'bmaa first check ',left_node_set,right_node_set,this%exact call ESMF_TimePrint(this%left_node%time,options='string',preString='left bracket time: ') call ESMF_TimePrint(this%right_node%time,options='string',preString='right bracket time: ') - !call this%right_node%get(file=right_file) - !call this%left_node%get(file=left_file) - !right_node_set = right_file /= file_not_found - !left_node_set = left_file /= file_not_found alpha = 0.0 if ( (.not.this%disable_interpolation) .and. (.not.this%intermittent_disable) .and. right_node_set .and. left_node_set) then @@ -209,7 +204,6 @@ subroutine interpolate_to_time(this,field,time,rc) if (left_node_set) then call assign_fptr(this%left_node%field,var1d_left,_RC) end if - write(*,*)'bmaa inter: ',left_node_set, right_node_set,this%new_file_left, this%new_file_right if ( left_node_set .and. (time == this%left_node%time .or. this%disable_interpolation)) then var1d = var1d_left else if (right_node_set .and. (time == this%right_node%time)) then @@ -223,7 +217,6 @@ subroutine interpolate_to_time(this,field,time,rc) end if if (this%exact .and. (.not.(time == this%left_node%time))) then - !write(*,*)'bmaa setting undef' var1d = mapl_undef end if @@ -250,14 +243,11 @@ subroutine swap_node_fields(this,rc) left_created = ESMF_FieldIsCreated(this%left_node%field,_RC) right_created = ESMF_FieldIsCreated(this%right_node%field,_RC) - write(*,*)'bmaa swapping nodes ',left_created,right_created left_created = ESMF_FieldIsCreated(this%left_node%field,_RC) if (left_created .and. right_created) then call assign_fptr(this%left_node%field,left_ptr,_RC) call assign_fptr(this%right_node%field,right_ptr,_RC) - write(*,*)'bmaa LR before: ',maxval(left_ptr),maxval(right_ptr) left_ptr = right_ptr - write(*,*)'bmaa LR after: ',maxval(left_ptr),maxval(right_ptr) end if _RETURN(_SUCCESS) end subroutine swap_node_fields From 8d71ed26125c43be16d9da0d5bf681b9a8c2e080 Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Tue, 21 Jan 2025 13:51:13 -0500 Subject: [PATCH 06/12] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d2fdf3ce41b7..fa1e600a23b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option - Changed MAPL_ESMFRegridder to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue - Increased formatting width of time index in ExtData2G diagnostic print - Updated GitHub checkout action to use blobless clones From 46c64734614bb3504dfe3e38adfd483d8d5b7de6 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 22 Jan 2025 10:29:03 -0500 Subject: [PATCH 07/12] Update to ESMA_env v4.34.1 --- CHANGELOG.md | 6 +++++- components.yaml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 643edd7ab418..8ef520106474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option +- Update `components.yaml` + - `ESMA_env` v4.34.1 + - Fix GEOSpyD module on GMAO Desktops + ### Fixed ### Removed @@ -31,7 +36,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option - Changed MAPL_ESMFRegridder to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue - Increased formatting width of time index in ExtData2G diagnostic print - Updated GitHub checkout action to use blobless clones diff --git a/components.yaml b/components.yaml index bedab2379e88..27bfcc960af7 100644 --- a/components.yaml +++ b/components.yaml @@ -5,7 +5,7 @@ MAPL: ESMA_env: local: ./ESMA_env remote: ../ESMA_env.git - tag: v4.34.0 + tag: v4.34.1 develop: main ESMA_cmake: From 6bfafd9ecfb00606f9fa5933c051635ea62d52c4 Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Wed, 22 Jan 2025 10:44:04 -0500 Subject: [PATCH 08/12] fix changlog and remove prints --- CHANGELOG.md | 3 +-- gridcomps/ExtData2G/ExtDataBracket.F90 | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 643edd7ab418..64ca8a4610ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed +- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option ### Fixed @@ -31,8 +32,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed -- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option -- Changed MAPL_ESMFRegridder to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue - Increased formatting width of time index in ExtData2G diagnostic print - Updated GitHub checkout action to use blobless clones - Update CI to use Baselibs 7.29.0 by default diff --git a/gridcomps/ExtData2G/ExtDataBracket.F90 b/gridcomps/ExtData2G/ExtDataBracket.F90 index 9fff7624bbb3..8c8c84da4f7f 100644 --- a/gridcomps/ExtData2G/ExtDataBracket.F90 +++ b/gridcomps/ExtData2G/ExtDataBracket.F90 @@ -188,8 +188,6 @@ subroutine interpolate_to_time(this,field,time,rc) right_node_set = this%right_node%check_if_initialized(_RC) left_node_set = this%left_node%check_if_initialized(_RC) - call ESMF_TimePrint(this%left_node%time,options='string',preString='left bracket time: ') - call ESMF_TimePrint(this%right_node%time,options='string',preString='right bracket time: ') alpha = 0.0 if ( (.not.this%disable_interpolation) .and. (.not.this%intermittent_disable) .and. right_node_set .and. left_node_set) then From f306557e9d4dc871344e913c7ca09a4c0bfd493b Mon Sep 17 00:00:00 2001 From: Benjamin Auer Date: Wed, 22 Jan 2025 13:05:48 -0500 Subject: [PATCH 09/12] restore missing line in changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 64ca8a4610ba..ef026ba9b20a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Changed MAPL_ESMFRegridder to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue - Increased formatting width of time index in ExtData2G diagnostic print - Updated GitHub checkout action to use blobless clones - Update CI to use Baselibs 7.29.0 by default From b2aa81733b74a0ca35cfa5688c54cc152d0ca6c9 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Wed, 22 Jan 2025 18:13:28 -0500 Subject: [PATCH 10/12] Fix up changelog --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f99a4931799e..8ef520106474 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,7 +10,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed -- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option - Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option - Update `components.yaml` From 260d563d08ff0d3e8436ec33ed98a362110e731b Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Thu, 23 Jan 2025 13:35:20 -0500 Subject: [PATCH 11/12] Update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef026ba9b20a..25e2e361ff82 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,10 +10,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added ### Changed + - Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option ### Fixed +- Changes were made to add attributes to the subgrids (i.e. created by dividing the MPI subdomain into smaller subdomains equal to the number of OpenMP threads) such that the correct dimensions for the MPI subdomain could be retrieved from the subgrids where ever needed. + ### Removed ### Deprecated From beebb2927b831a2cc605386e7d1c0bec9f58eef6 Mon Sep 17 00:00:00 2001 From: Matthew Thompson Date: Fri, 24 Jan 2025 10:49:40 -0500 Subject: [PATCH 12/12] Prepare for 2.53.0 Release --- CHANGELOG.md | 14 ++++++++++---- CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a15e7a69c76..5277ee59e9f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +### Fixed + +### Removed + +### Deprecated + +## [2.53.0] - 2025-01-24 + +### Changed + - Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option - Update `components.yaml` - `ESMA_env` v4.34.1 @@ -20,10 +30,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changes were made to add attributes to the subgrids (i.e. created by dividing the MPI subdomain into smaller subdomains equal to the number of OpenMP threads) such that the correct dimensions for the MPI subdomain could be retrieved from the subgrids where ever needed. -### Removed - -### Deprecated - ## [2.52.0] - 2025-01-17 ### Added diff --git a/CMakeLists.txt b/CMakeLists.txt index 83113960be62..4e8f157d3579 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ endif () project ( MAPL - VERSION 2.52.0 + VERSION 2.53.0 LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF # Set the possible values of build type for cmake-gui