Skip to content

Commit

Permalink
Fix to allow quilting with non-factors for layout (NOAA-EMC#192)
Browse files Browse the repository at this point in the history
* Fix to allow quilting with non-factors for layout (NOAA-EMC#244)
* Remove the inline comments
  • Loading branch information
chan-hoo authored Nov 23, 2020
1 parent 4fdf7c6 commit b6957d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
type(ESMF_Array) :: array_work, array
type(ESMF_FieldBundle) :: fieldbdl_work
type(ESMF_Field) :: field_work, field
type(ESMF_Decomp_Flag) :: decompflagPTile(2,6)

character(len=80) :: attrValueSList(2)
type(ESMF_StateItem_Flag), allocatable :: fcstItemTypeList(:)
Expand Down Expand Up @@ -290,6 +291,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
do tl=1,6
decomptile(1,tl) = 1
decomptile(2,tl) = jidx
decompflagPTile(:,tl) = (/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/)
enddo
call ESMF_AttributeGet(imp_state_write, convention="NetCDF", purpose="FV3", &
name="gridfile", value=gridfile, rc=rc)
Expand All @@ -298,6 +300,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
CALL ESMF_LogWrite("wrtComp: gridfile:"//trim(gridfile),ESMF_LOGMSG_INFO,rc=rc)
wrtgrid = ESMF_GridCreateMosaic(filename="INPUT/"//trim(gridfile), &
regDecompPTile=decomptile,tileFilePath="INPUT/", &
decompflagPTile=decompflagPTile, &
staggerlocList=(/ESMF_STAGGERLOC_CENTER, ESMF_STAGGERLOC_CORNER/), &
name='wrt_grid', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand All @@ -319,6 +322,7 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
! create the nest Grid by reading it from file but use DELayout
wrtGrid = ESMF_GridCreate(filename="INPUT/"//trim(gridfile), &
fileformat=ESMF_FILEFORMAT_GRIDSPEC, regDecomp=regDecomp, &
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
delayout=delayout, isSphere=.false., indexflag=ESMF_INDEX_DELOCAL, &
rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand Down
6 changes: 6 additions & 0 deletions module_fcst_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
integer, allocatable, dimension(:) :: isl, iel, jsl, jel
integer, allocatable, dimension(:,:,:) :: deBlockList

type(ESMF_Decomp_Flag) :: decompflagPTile(2,6)

integer :: globalTileLayout(2)
integer :: nestRootPet, peListSize(1)
integer, allocatable :: petMap(:)
Expand Down Expand Up @@ -431,6 +433,7 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
maxIndex=(/atm_int_state%Atm%mlon,atm_int_state%Atm%mlat/), &
gridEdgeLWidth=(/0,0/), &
gridEdgeUWidth=(/0,0/), &
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
name="fcst_grid", &
indexflag=ESMF_INDEX_DELOCAL, &
rc=rc); ESMF_ERR_ABORT(rc)
Expand Down Expand Up @@ -468,9 +471,11 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
do tl=1,6
decomptile(1,tl) = atm_int_state%Atm%layout(1)
decomptile(2,tl) = atm_int_state%Atm%layout(2)
decompflagPTile(:,tl) = (/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/)
enddo
fcstGrid = ESMF_GridCreateMosaic(filename="INPUT/"//trim(gridfile), &
regDecompPTile=decomptile,tileFilePath="INPUT/", &
decompflagPTile=decompflagPTile, &
staggerlocList=(/ESMF_STAGGERLOC_CENTER, ESMF_STAGGERLOC_CORNER/), &
name='fcst_grid', rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand Down Expand Up @@ -518,6 +523,7 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
! create the nest Grid by reading it from file but use DELayout
fcstGrid = ESMF_GridCreate(filename='INPUT/grid.nest02.tile7.nc', &
fileformat=ESMF_FILEFORMAT_GRIDSPEC, regDecomp=regDecomp, &
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
delayout=delayout, isSphere=.false., indexflag=ESMF_INDEX_DELOCAL, &
rc=rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand Down

0 comments on commit b6957d8

Please sign in to comment.