Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/feature/wdboggs/out…
Browse files Browse the repository at this point in the history
…er_meta_component_datetime_compatibility_3357' into feature/wdboggs/outer_meta_component_datetime_compatibility_3357
  • Loading branch information
darianboggs committed Jan 30, 2025
2 parents 6003ff7 + 84cfbfc commit f150f88
Show file tree
Hide file tree
Showing 28 changed files with 1,495 additions and 60 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### 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
- Fix GEOSpyD module on GMAO Desktops

### 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.

## [2.52.0] - 2025-01-17

### Added
Expand All @@ -102,7 +115,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
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
66 changes: 53 additions & 13 deletions base/Base/Base_Base_implementation.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1572,11 +1572,26 @@ module subroutine MAPL_GRID_INTERIOR(GRID,I1,IN,J1,JN)
integer :: gridRank
integer, allocatable :: localDeToDeMap(:)
integer :: rc
logical :: isPresent
integer :: global_grid_info(10)
type(ESMF_Info) :: infoh

i1=-1
j1=-1
in=-1
jn=-1

call ESMF_InfoGetFromHost(grid,infoh,_RC)
isPresent = ESMF_InfoIsPresent(infoh,'GLOBAL_GRID_INFO',_RC)
if (isPresent) then
call ESMF_InfoGet(infoh, key="GLOBAL_GRID_INFO", values=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)
Expand Down Expand Up @@ -2150,6 +2165,26 @@ module subroutine MAPL_GridGetInterior(GRID,I1,IN,J1,JN)
integer :: deId
integer :: gridRank
integer :: rc
logical :: isPresent
integer :: global_grid_info(10)
type(ESMF_Info) :: infoh

i1=-1
j1=-1
in=-1
jn=-1

call ESMF_InfoGetFromHost(grid,infoh,_RC)
isPresent = ESMF_InfoIsPresent(infoh,'GLOBAL_GRID_INFO',_RC)
if (isPresent) then
call ESMF_InfoGet(infoh, key="GLOBAL_GRID_INFO", values=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)
Expand Down Expand Up @@ -2655,10 +2690,10 @@ 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_InfoGetFromHost(grid,infoh,_RC)
call ESMF_InfoGet(infoh, key='GridType', value=grid_type, _RC)
if(trim(grid_type) == "Cubed-Sphere") then
! call ESMF_InfoGetFromHost(grid,infoh,_RC)
! call ESMF_InfoGet(infoh, key='GridType', value=grid_type, _RC)
! if(trim(grid_type) == "Cubed-Sphere") then
if (im_world*6==jm_world) then

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

Expand Down Expand Up @@ -2897,28 +2932,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
Expand Down
10 changes: 10 additions & 0 deletions base/MaplGrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,21 @@ subroutine MAPL_GridGet(GRID, globalCellCountPerDim, localCellCountPerDim, layou
type(ESMF_DistGrid) :: distGrid
integer, allocatable :: maxindex(:,:),minindex(:,:)
integer, pointer :: ims(:),jms(:)
integer :: global_grid_info(10)
type(ESMF_Info) :: infoh

pglobal = present(globalCellCountPerDim)
plocal = present(localCellCountPerDim)

call ESMF_InfoGetFromHost(grid,infoh,_RC)
isPresent = ESMF_InfoIsPresent(infoh,'GLOBAL_GRID_INFO',_RC)
if (isPresent) then
call ESMF_InfoGet(infoh, key="GLOBAL_GRID_INFO", values=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)
call ESMF_InfoGetFromHost(grid,infoh,_RC)
Expand Down
2 changes: 1 addition & 1 deletion components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
20 changes: 18 additions & 2 deletions generic/OpenMP_Support.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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_
Expand All @@ -103,7 +104,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)

Expand Down Expand Up @@ -179,6 +180,21 @@ function make_subgrids_from_bounds(primary_grid, bounds, unusable, rc) result(su
values=lons1d, _RC)
call ESMF_InfoSet(infoh, key='GridCornerLats:', &
values=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
call ESMF_InfoSet(infoh, key="GLOBAL_GRID_INFO", values=global_grid_info, _RC)
end block

deallocate(lons1d, lats1d)
deallocate(new_corner_lons, new_corner_lats)
Expand Down
5 changes: 4 additions & 1 deletion generic3g/specs/AttributesAspect.F90
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
! be unused and/or correspond to attributes needed by other imports.

module mapl3g_AttributesAspect
use mapl3g_ActualConnectionPt
use mapl3g_AspectId
use mapl3g_StateItemAspect
use mapl3g_ExtensionAction
Expand Down Expand Up @@ -124,14 +125,16 @@ function get_aspect_id() result(aspect_id)
end function get_aspect_id

! No-op (cannot mirror)
subroutine connect_to_export(this, export, rc)
subroutine connect_to_export(this, export, actual_pt, rc)
class(AttributesAspect), intent(inout) :: this
class(StateItemAspect), intent(in) :: export
type(ActualConnectionPt), intent(in) :: actual_pt
integer, optional, intent(out) :: rc

_RETURN(_SUCCESS)
_UNUSED_DUMMY(this)
_UNUSED_DUMMY(export)
_UNUSED_DUMMY(actual_pt)
end subroutine connect_to_export

end module mapl3g_AttributesAspect
Loading

0 comments on commit f150f88

Please sign in to comment.