From 1206994e944c8b4f2b7c325f01d836efe29ff5a1 Mon Sep 17 00:00:00 2001 From: "Chan-hoo.Jeon" Date: Tue, 27 Oct 2020 15:38:22 +0000 Subject: [PATCH 1/2] Fix to allow quilting with non-factors for layout (#244) --- io/module_wrt_grid_comp.F90 | 18 +++++++++++++++++- module_fcst_grid_comp.F90 | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index 3339628e8..15e250b85 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -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 ---------- character(len=80) :: attrValueSList(2) type(ESMF_StateItem_Flag), allocatable :: fcstItemTypeList(:) @@ -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) @@ -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 @@ -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 @@ -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 diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 63b392f7d..20b9f3bf1 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -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(:) @@ -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) @@ -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 @@ -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 From efdef3a689c696fdb3515d789cc2b496c04256a4 Mon Sep 17 00:00:00 2001 From: "Chan-hoo.Jeon" Date: Tue, 3 Nov 2020 16:07:46 +0000 Subject: [PATCH 2/2] Remove the inline comments --- io/module_wrt_grid_comp.F90 | 12 ------------ module_fcst_grid_comp.F90 | 10 ---------- 2 files changed, 22 deletions(-) diff --git a/io/module_wrt_grid_comp.F90 b/io/module_wrt_grid_comp.F90 index 15e250b85..eb9c63677 100644 --- a/io/module_wrt_grid_comp.F90 +++ b/io/module_wrt_grid_comp.F90 @@ -160,9 +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 -! CHJ --- Gerhard's update: quilting with non-factors for layout --- s --- type(ESMF_Decomp_Flag) :: decompflagPTile(2,6) -! CHJ --- Gerhard's update --- e ---------- character(len=80) :: attrValueSList(2) type(ESMF_StateItem_Flag), allocatable :: fcstItemTypeList(:) @@ -293,9 +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 -! 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) @@ -304,9 +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/", & -! 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 @@ -328,9 +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, & -! 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 @@ -695,11 +687,7 @@ 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 -! 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 diff --git a/module_fcst_grid_comp.F90 b/module_fcst_grid_comp.F90 index 20b9f3bf1..7742eefbc 100644 --- a/module_fcst_grid_comp.F90 +++ b/module_fcst_grid_comp.F90 @@ -211,9 +211,7 @@ 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) @@ -435,9 +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/), & -! 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) @@ -475,15 +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) -! 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 @@ -531,9 +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, & -! 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