Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to allow quilting with non-factors for layout #192

Merged
merged 3 commits into from
Nov 23, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion io/module_wrt_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ 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
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
type(ESMF_Decomp_Flag) :: decompflagPTile(2,6)
! CHJ --- Gerhard's update --- e ----------
DusanJovic-NOAA marked this conversation as resolved.
Show resolved Hide resolved

character(len=80) :: attrValueSList(2)
type(ESMF_StateItem_Flag), allocatable :: fcstItemTypeList(:)
Expand Down Expand Up @@ -290,6 +293,9 @@ 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
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflagPTile(:,tl) = (/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/)
! CHJ --- Gerhard's update --- e ----------
enddo
call ESMF_AttributeGet(imp_state_write, convention="NetCDF", purpose="FV3", &
name="gridfile", value=gridfile, rc=rc)
Expand All @@ -298,6 +304,9 @@ 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/", &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflagPTile=decompflagPTile, &
! CHJ --- Gerhard's update --- e ----------
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 +328,9 @@ 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, &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
! CHJ --- Gerhard's update --- e ----------
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 Expand Up @@ -683,7 +695,11 @@ subroutine wrt_initialize(wrt_comp, imp_state_write, exp_state_write, clock, rc)
if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
!
! get output file name
call ESMF_AttributeGet(fcstField(i), convention="NetCDF", purpose="FV3", &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
! call ESMF_AttributeGet(fcstField(i), convention="NetCDF", purpose="FV3", &
call ESMF_AttributeGet(fcstField(j), convention="NetCDF", purpose="FV3", &
! CHJ --- Gerhard's update --- e ----------

name="output_file", value=outfile_name, rc=rc)

if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, line=__LINE__, file=__FILE__)) return
Expand Down
16 changes: 16 additions & 0 deletions module_fcst_grid_comp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ subroutine fcst_initialize(fcst_comp, importState, exportState, clock, rc)
integer, allocatable, dimension(:) :: isl, iel, jsl, jel
integer, allocatable, dimension(:,:,:) :: deBlockList

! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
type(ESMF_Decomp_Flag) :: decompflagPTile(2,6)
! CHJ --- Gerhard's update --- e ----------

integer :: globalTileLayout(2)
integer :: nestRootPet, peListSize(1)
integer, allocatable :: petMap(:)
Expand Down Expand Up @@ -431,6 +435,9 @@ 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/), &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
! CHJ --- Gerhard's update --- e ----------
name="fcst_grid", &
indexflag=ESMF_INDEX_DELOCAL, &
rc=rc); ESMF_ERR_ABORT(rc)
Expand Down Expand Up @@ -468,9 +475,15 @@ 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)
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflagPTile(:,tl) = (/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/)
! CHJ --- Gerhard's update --- e ----------
enddo
fcstGrid = ESMF_GridCreateMosaic(filename="INPUT/"//trim(gridfile), &
regDecompPTile=decomptile,tileFilePath="INPUT/", &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflagPTile=decompflagPTile, &
! CHJ --- Gerhard's update --- e ----------
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 +531,9 @@ 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, &
! CHJ --- Gerhard's update: quilting with non-factors for layout --- s ---
decompflag=(/ESMF_DECOMP_SYMMEDGEMAX,ESMF_DECOMP_SYMMEDGEMAX/), &
! CHJ --- Gerhard's update --- e ----------
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