Skip to content

Commit 572a644

Browse files
authored
Merge pull request #3363 from GEOS-ESM/develop
2 parents c41f37c + 142a615 commit 572a644

23 files changed

+271
-51
lines changed

CHANGELOG.md

+14-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717

1818
### Deprecated
1919

20+
## [2.53.0] - 2025-01-24
21+
22+
### Changed
23+
24+
- Updated ExtData so that if files are missing in a sequence the last value will be perisisted if one has not chosen `exact` option
25+
- Update `components.yaml`
26+
- `ESMA_env` v4.34.1
27+
- Fix GEOSpyD module on GMAO Desktops
28+
29+
### Fixed
30+
31+
- 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.
32+
2033
## [2.52.0] - 2025-01-17
2134

2235
### Added
@@ -31,7 +44,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3144

3245
### Changed
3346

34-
- Changed `MAPL_ESMFRegridder` to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue
47+
- Changed MAPL_ESMFRegridder to require the dstMaskValues to be added as grid attribute to use fixed masking, fixes UFS issue
3548
- Increased formatting width of time index in ExtData2G diagnostic print
3649
- Updated GitHub checkout action to use blobless clones
3750
- Update CI to use Baselibs 7.29.0 by default

CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ endif ()
88

99
project (
1010
MAPL
11-
VERSION 2.52.0
11+
VERSION 2.53.0
1212
LANGUAGES Fortran CXX C) # Note - CXX is required for ESMF
1313

1414
# Set the possible values of build type for cmake-gui

Tests/ExtDataRoot_GridComp.F90

+8-27
Original file line numberDiff line numberDiff line change
@@ -677,12 +677,8 @@ subroutine CompareState(State1,State2,tol,rc)
677677

678678
integer :: status
679679
integer :: i
680-
real, pointer :: ptr3_1(:,:,:)
681-
real, pointer :: ptr3_2(:,:,:)
682-
real, pointer :: ptr2_1(:,:)
683-
real, pointer :: ptr2_2(:,:)
684-
real, pointer :: ptr1_1(:)
685-
real, pointer :: ptr1_2(:)
680+
real, pointer :: ptr1(:)
681+
real, pointer :: ptr2(:)
686682
integer :: itemcount,rank1,rank2
687683
character(len=ESMF_MAXSTR), allocatable :: NameList(:)
688684
logical, allocatable :: foundDiff(:)
@@ -706,25 +702,12 @@ subroutine CompareState(State1,State2,tol,rc)
706702
exit
707703
end if
708704
_ASSERT(rank1==rank2,'needs informative message')
705+
call assign_fptr(field1, ptr1, _RC)
706+
call assign_fptr(field2, ptr2, _RC)
707+
_ASSERT(size(ptr1)==size(ptr2),'needs informative message')
709708
foundDiff(i)=.false.
710-
if (rank1==1) then
711-
call MAPL_GetPointer(state1,ptr1_1,trim(nameList(i)),_RC)
712-
call MAPL_GetPointer(state2,ptr1_2,trim(nameList(i)),_RC)
713-
if (any((ptr1_1-ptr1_2) > tol)) then
714-
foundDiff(i) = .true.
715-
end if
716-
else if (rank1==2) then
717-
call MAPL_GetPointer(state1,ptr2_1,trim(nameList(i)),_RC)
718-
call MAPL_GetPointer(state2,ptr2_2,trim(nameList(i)),_RC)
719-
if (any((ptr2_1-ptr2_2) > tol)) then
720-
foundDiff(i) = .true.
721-
end if
722-
else if (rank1==3) then
723-
call MAPL_GetPointer(state1,ptr3_1,trim(nameList(i)),_RC)
724-
call MAPL_GetPointer(state2,ptr3_2,trim(nameList(i)),_RC)
725-
if (any((ptr3_1-ptr3_2) > tol)) then
726-
foundDiff(i) = .true.
727-
end if
709+
if (any(abs(ptr1-ptr2) > tol)) then
710+
foundDiff(i) = .true.
728711
end if
729712
if (foundDiff(i)) then
730713
_FAIL('found difference when compare state')
@@ -741,10 +724,8 @@ subroutine ForceAllocation(state,rc)
741724

742725
integer :: status
743726

744-
real, pointer :: ptr3d(:,:,:)
745-
real, pointer :: ptr2d(:,:)
746727
integer :: ii
747-
integer :: itemcount,dims
728+
integer :: itemcount
748729
character(len=ESMF_MAXSTR), allocatable :: NameList(:)
749730
type (ESMF_StateItem_Flag), allocatable :: itemTypeList(:)
750731
type(ESMF_Field) :: Field
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
NX: 1
2+
NY: 1
3+
4+
Root.GRID_TYPE: LatLon
5+
Root.GRIDNAME: DC90x45-PC
6+
Root.LM: 3
7+
Root.IM_WORLD: 90
8+
Root.JM_WORLD: 45
9+
Root.POLE: 'PC'
10+
Root.DATELINE: 'DC'
11+
12+
RUN_MODE: GenerateExports
13+
14+
EXPORT_STATE::
15+
VAR1 , time , days , xy , c
16+
::
17+
18+
FILL_DEF::
19+
VAR1 time
20+
::
21+
22+
REF_TIME: 20070927 000000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
NX: 1
2+
NY: 1
3+
4+
Root.GRID_TYPE: LatLon
5+
Root.GRIDNAME: DC90x45-PC
6+
Root.LM: 3
7+
Root.IM_WORLD: 90
8+
Root.JM_WORLD: 90
9+
Root.POLE: 'PC'
10+
Root.DATELINE: 'DC'
11+
12+
RUN_MODE: GenerateExports
13+
14+
EXPORT_STATE::
15+
VAR1 , time , days , xy , c
16+
::
17+
18+
FILL_DEF::
19+
VAR1 time
20+
::
21+
22+
REF_TIME: 20070927 000000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
NX: 1
2+
NY: 1
3+
4+
Root.GRID_TYPE: LatLon
5+
Root.GRIDNAME: DC900x45-PC
6+
Root.LM: 3
7+
Root.IM_WORLD: 90
8+
Root.JM_WORLD: 45
9+
Root.POLE: 'PC'
10+
Root.DATELINE: 'DC'
11+
12+
RUN_MODE: CompareImports
13+
14+
IMPORT_STATE::
15+
VAR1 , time , days , xy , c
16+
::
17+
18+
EXPORT_STATE::
19+
VAR1 , time , days , xy , c
20+
::
21+
22+
FILL_DEF::
23+
VAR1 3.0
24+
::
25+
26+
REF_TIME: 20080101 000000
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CASES::
2+
CAP1.rc
3+
CAP2.rc
4+
CAP3.rc
5+
::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ROOT_NAME: Root
2+
ROOT_CF: AGCM1.rc
3+
HIST_CF: HISTORY1.rc
4+
5+
BEG_DATE: 20070926 230000
6+
7+
JOB_SGMT: 00000004 000000
8+
HEARTBEAT_DT: 3600
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
ROOT_NAME: Root
2+
ROOT_CF: AGCM2.rc
3+
HIST_CF: HISTORY2.rc
4+
5+
BEG_DATE: 20071001 210000
6+
7+
JOB_SGMT: 00000003 000000
8+
HEARTBEAT_DT: 3600
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
ROOT_NAME: Root
2+
ROOT_CF: AGCM3.rc
3+
HIST_CF: HISTORY3.rc
4+
5+
BEG_DATE: 20070930 000000
6+
7+
JOB_SGMT: 00000001 120000
8+
HEARTBEAT_DT: 3600
9+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#CASE_SENSITIVE_VARIABLE_NAMES: .false.
2+
Ext_AllowExtrap: .false.
3+
Prefetch: .true.
4+
DEBUG_LEVEL: 20
5+
6+
PrimaryExports%%
7+
VAR2D NA 2008 N 0 none none VAR2D case1.nc4
8+
%%
9+
10+
11+
DerivedExports%%
12+
%%
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GRID_LABELS:
2+
::
3+
4+
COLLECTIONS: case1
5+
::
6+
7+
case1.template: '%y4%m2%d2.nc4',
8+
case1.format: 'CFIO',
9+
case1.frequency: 240000,
10+
#case1.duration: 000000,
11+
case1.ref_time: 000000,
12+
case1.fields: 'VAR1', 'Root',
13+
::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GRID_LABELS:
2+
::
3+
4+
COLLECTIONS: case1
5+
::
6+
7+
case1.template: '%y4%m2%d2.nc4',
8+
case1.format: 'CFIO',
9+
case1.frequency: 240000,
10+
#case1.duration: 000000,
11+
case1.ref_time: 000000,
12+
case1.fields: 'VAR1', 'Root',
13+
::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
GRID_LABELS:
2+
::
3+
4+
COLLECTIONS:
5+
::
6+
7+
case2.template: 'nc4',
8+
case2.format: 'CFIO',
9+
case2.frequency: 240000,
10+
case2.duration: 000000,
11+
case2.ref_time: 000000,
12+
case2.fields: 'VAR2D', 'Root',
13+
::
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
test multiple datasets where an export uses both with with no extrapolation outside and crosses transition date
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Collections:
2+
fstream1: {template: "case1.%y4%m2%d2.nc4", valid_range: "2007-09-22/2007-09-30"}
3+
fstream2: {template: "case2.%y4%m2%d2.nc4", valid_range: "2007-10-01/2007-10-08"}
4+
5+
Samplings:
6+
s1:
7+
time_interpolation: False
8+
9+
Exports:
10+
VAR1:
11+
- {starting: "2007-09-22", variable: VAR1, collection: fstream1, sample: s1, fail_on_missing_file: false}
12+
- {starting: "2007-10-01", variable: VAR1, collection: fstream2, sample: s1, fail_on_missing_file: false}

Tests/ExtData_Testing_Framework/test_cases/extdata_2g_cases.txt

+1
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,4 @@ case33
3434
case34
3535
case35
3636
case36
37+
case37

base/Base/Base_Base_implementation.F90

+46-12
Original file line numberDiff line numberDiff line change
@@ -1557,11 +1557,24 @@ module subroutine MAPL_GRID_INTERIOR(GRID,I1,IN,J1,JN)
15571557
integer :: gridRank
15581558
integer, allocatable :: localDeToDeMap(:)
15591559
integer :: rc
1560+
logical :: isPresent
1561+
integer :: global_grid_info(10)
15601562

15611563
i1=-1
15621564
j1=-1
15631565
in=-1
15641566
jn=-1
1567+
1568+
call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", isPresent=isPresent, _RC)
1569+
if (isPresent) then
1570+
call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", valueList=global_grid_info, _RC)
1571+
I1 = global_grid_info(7)
1572+
IN = global_grid_info(8)
1573+
j1 = global_grid_info(9)
1574+
JN = global_grid_info(10)
1575+
_RETURN(_SUCCESS)
1576+
end if
1577+
15651578
call ESMF_GridGet (GRID, dimCount=gridRank, distGrid=distGrid, _RC)
15661579
call ESMF_DistGridGet(distGRID, delayout=layout, _RC)
15671580
call ESMF_DELayoutGet(layout, deCount = nDEs, localDeCount=localDeCount,_RC)
@@ -2138,6 +2151,24 @@ module subroutine MAPL_GridGetInterior(GRID,I1,IN,J1,JN)
21382151
integer :: deId
21392152
integer :: gridRank
21402153
integer :: rc
2154+
logical :: isPresent
2155+
integer :: global_grid_info(10)
2156+
2157+
i1=-1
2158+
j1=-1
2159+
in=-1
2160+
jn=-1
2161+
2162+
call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", isPresent=isPresent, _RC)
2163+
if (isPresent) then
2164+
call ESMF_AttributeGet(grid, name="GLOBAL_GRID_INFO", valueList=global_grid_info, _RC)
2165+
I1 = global_grid_info(7)
2166+
IN = global_grid_info(8)
2167+
j1 = global_grid_info(9)
2168+
JN = global_grid_info(10)
2169+
_RETURN(_SUCCESS)
2170+
end if
2171+
21412172

21422173
call ESMF_GridGet (GRID, dimCount=gridRank, distGrid=distGrid, _RC)
21432174
call ESMF_DistGridGet(distGRID, delayout=layout, _RC)
@@ -2627,9 +2658,7 @@ module subroutine MAPL_GetHorzIJIndex(npts,II,JJ,lon,lat,lonR8,latR8,Grid, rc)
26272658
tmp_lats = latR8
26282659
end if
26292660

2630-
!AOO change tusing GridType atribute if (im_world*6==jm_world) then
2631-
call ESMF_AttributeGet(grid, name='GridType', value=grid_type, _RC)
2632-
if(trim(grid_type) == "Cubed-Sphere") then
2661+
if (im_world*6==jm_world) then
26332662

26342663
call MAPL_GetGlobalHorzIJIndex(npts, II, JJ, lon=lon, lat=lat, lonR8=lonR8, latR8=latR8, Grid=Grid, _RC)
26352664

@@ -2868,28 +2897,33 @@ function grid_is_ok(grid) result(OK)
28682897
type(ESMF_Grid), intent(inout) :: grid
28692898
logical :: OK
28702899
integer :: I1, I2, J1, J2, j
2871-
real(ESMF_KIND_R8), pointer :: corner_lons(:,:), corner_lats(:,:)
2900+
real(ESMF_KIND_R8), allocatable :: corner_lons(:,:), corner_lats(:,:)
28722901
real(ESMF_KIND_R8), allocatable :: lonRe(:), latRe(:)
28732902
real(ESMF_KIND_R8), allocatable :: accurate_lat(:), accurate_lon(:)
28742903
real(ESMF_KIND_R8) :: stretch_factor, target_lon, target_lat, shift0
28752904
real :: tolerance
2905+
integer :: local_dims(3)
28762906

28772907
tolerance = epsilon(1.0)
28782908
call MAPL_GridGetInterior(grid,I1,I2,J1,J2)
2909+
call MAPL_GridGet(grid, localCellCountPerDim=local_dims, _RC)
28792910
OK = .true.
28802911
! check the edge of face 1 along longitude
2881-
call ESMF_GridGetCoord(grid,localDE=0,coordDim=1,staggerloc=ESMF_STAGGERLOC_CORNER, &
2882-
farrayPtr=corner_lons, rc=status)
2883-
call ESMF_GridGetCoord(grid,localDE=0,coordDim=2,staggerloc=ESMF_STAGGERLOC_CORNER, &
2884-
farrayPtr=corner_lats, rc=status)
2912+
!call ESMF_GridGetCoord(grid,localDE=0,coordDim=1,staggerloc=ESMF_STAGGERLOC_CORNER, &
2913+
! farrayPtr=corner_lons, _RC)
2914+
!call ESMF_GridGetCoord(grid,localDE=0,coordDim=2,staggerloc=ESMF_STAGGERLOC_CORNER, &
2915+
! farrayPtr=corner_lats, _RC)
2916+
allocate(corner_lons(local_dims(1)+1, local_dims(2)+1))
2917+
allocate(corner_lats(local_dims(1)+1, local_dims(2)+1))
2918+
call MAPL_GridGetCorners(grid, corner_lons, corner_lats, _RC)
28852919

28862920

28872921
if ( I1 == 1 .and. J1 == 1 ) then
2888-
allocate(lonRe(j2-j1+1), latRe(j2-j1+1))
2889-
call MAPL_Reverse_Schmidt(grid, stretched, J2-J1+1, lonR8=corner_lons(1,:), &
2890-
latR8=corner_lats(1,:), lonRe=lonRe, latRe=latRe, _RC)
2922+
allocate(lonRe(local_dims(2)), latRe(local_dims(2)))
2923+
call MAPL_Reverse_Schmidt(grid, stretched, local_dims(2), lonR8=corner_lons(1,1:local_dims(2)), &
2924+
latR8=corner_lats(1,1:local_dims(2)), lonRe=lonRe, latRe=latRe, _RC)
28912925

2892-
allocate(accurate_lon(j2-j1+1), accurate_lat(j2-j1+1))
2926+
allocate(accurate_lon(local_dims(2)), accurate_lat(local_dims(2)))
28932927

28942928
shift0 = shift
28952929
if (stretched) shift0 = 0

0 commit comments

Comments
 (0)