diff --git a/reg_tests/cpld_gridgen/parm/grid.nml.IN b/reg_tests/cpld_gridgen/parm/grid.nml.IN index a3fcb51f5..d0ef079d5 100644 --- a/reg_tests/cpld_gridgen/parm/grid.nml.IN +++ b/reg_tests/cpld_gridgen/parm/grid.nml.IN @@ -7,8 +7,6 @@ fv3dir='MOSAICDIR' topofile='TOPOGFILE' editsfile='EDITSFILE' res=RESNAME -atmres='MOSAICRES' -npx=NPX editmask=DO_MASKEDIT debug=DO_DEBUG do_postwgts=DO_POSTWGTS diff --git a/reg_tests/cpld_gridgen/rt.conf b/reg_tests/cpld_gridgen/rt.conf index acb5afabc..bc1992e14 100644 --- a/reg_tests/cpld_gridgen/rt.conf +++ b/reg_tests/cpld_gridgen/rt.conf @@ -1,31 +1,12 @@ ################################################################# # Baseline configurations +# For each listed OCN resolution, mapped ocean masks will be +# generated for C48,C96,C192,C384,C768 and C1152. For C3072 +# resources and memory will need to be increased. See rt.sh ################################################################# # TEST_NAME | - - C384_025 | - C192_050 | - C096_100 | - C048_500 | - -################################################################# -# Non-baseline configurations. -# These configurations have been tested on hera. For hera, the -# memory use for the C3072 config is approx 60% of the full node, -# C1152 is 12% of the full node and C768 is 8% of the full node. -# The default is set as 12g on RDHPCS platforms and should be -# sufficient for all but C3072. On hera C3072 requires approx 50min -# of wall clock and using --exclusive. See C3072 settings in rt.sh -# -# Note that the 5deg ocean cases are currently only supported on -# hera -################################################################# - - #C3072_025 | - #C1152_025 | - #C768_025 | - - #C192_025 | - #C048_500 | - #C096_500 | + mx025 + mx050 + mx100 + mx500 diff --git a/reg_tests/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index fa7e997d2..9beea531b 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -239,8 +239,7 @@ while read -r line || [ "$line" ]; do [[ $line =~ \# ]] && continue TEST_NAME=$(echo $line | cut -d'|' -f1 | sed -e 's/^ *//' -e 's/ *$//') - MOSAICRES=${TEST_NAME%_*} - TEST_NAME=${TEST_NAME##*_} + TEST_NAME=${TEST_NAME##mx} cd $PATHRT RUNDIR=$RUNDIR_ROOT/$TEST_NAME @@ -251,7 +250,6 @@ while read -r line || [ "$line" ]; do # OUTDIR_PATH is passed down to $PATHTR/ush/cpld_gridgen.sh # It MUST be set export OUTDIR_PATH=$RUNDIR - export MOSAICRES=$MOSAICRES cp $PATHTR/exec/cpld_gridgen $RUNDIR cp $PATHTR/ush/cpld_gridgen.sh $RUNDIR diff --git a/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md b/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md index 5521035e5..5aca75791 100644 --- a/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md +++ b/sorc/cpld_gridgen.fd/docs/cpld_gridgen.md @@ -239,7 +239,7 @@ the source tripole grid. grid_cice_NEMS_mx025.nc the CICE grid file used at runtime by CICE6 kmtu_cice_NEMS_mx025.nc the CICE mask file used at runtime by CICE6 mesh.mx025.nc the ocean and ice mesh file used at runtime by CICE6, MOM6, and CMEPS -C384.mx025.tile[1-6].nc the mapped ocean mask on the ATM tiles used to create ATM ICs consistent with the
fractional grid +C[XXX].mx025.tile[1-6].nc the mapped ocean mask on the ATM tiles used to create ATM ICs consistent with the
fractional grid for a given ATM resolution, where C[XXX]=C48,C96,C192,C384,C768 or C1152
diff --git a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 index a097b11c3..e6afcbea3 100644 --- a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 +++ b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 @@ -28,7 +28,7 @@ program gen_fixgrid use cicegrid, only: write_cicegrid use scripgrid, only: write_scripgrid use topoedits, only: add_topoedits, apply_topoedits - use charstrings, only: logmsg, res, dirsrc, dirout, atmres, fv3dir, editsfile + use charstrings, only: logmsg, res, atmres, dirsrc, dirout, fv3dir, editsfile use charstrings, only: maskfile, maskname, topofile, toponame, editsfile, staggerlocs, cdate, history use debugprint, only: checkseam, checkxlatlon, checkpoint use netcdf @@ -48,7 +48,7 @@ program gen_fixgrid character(len= 2) :: cstagger integer :: rc,ncid,id,xtype - integer :: i,j,k,i2,j2 + integer :: i,j,k,n,i2,j2 integer :: ii integer :: localPet, nPet logical :: fexist = .false. @@ -89,8 +89,6 @@ program gen_fixgrid print '(a)',' output grid tag '//trim(res) print '(a)',' supergrid source directory '//trim(dirsrc) print '(a)',' output grid directory '//trim(dirout) - print '(a)',' atm resolution '//trim(atmres) - print '(a,i6)',' fv3 tile grid size ',npx print '(a)',' atm mosaic directory '//trim(fv3dir) print '(a)',' MOM6 topography file '//trim(topofile) print '(a)',' MOM6 edits file '//trim(editsfile) @@ -486,23 +484,34 @@ program gen_fixgrid ! tiled files containing the mapped ocean mask !--------------------------------------------------------------------- - method=ESMF_REGRIDMETHOD_CONSERVE - fsrc = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP_land.nc' - fdst = trim(fv3dir)//'/'//trim(atmres)//'/'//trim(atmres)//'_mosaic.nc' - fwgt = trim(dirout)//'/'//'Ct.mx'//trim(res)//'.to.'//trim(atmres)//'.nc' - logmsg = 'creating weight file '//trim(fwgt) - print '(a)',trim(logmsg) + do n = 1,nar + npx = catm(n) + if (npx < 100) then + write(atmres,'(a,i2)')'C',npx + elseif (npx < 1000) then + write(atmres,'(a,i3)')'C',npx + else + write(atmres,'(a,i4)')'C',npx + end if - call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & - weightFile=trim(fwgt), regridmethod=method, & - unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, ignoreDegenerate=.true., & - netcdf4fileFlag=.true., tileFilePath=trim(fv3dir)//'/'//trim(atmres)//'/', rc=rc) - if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & - line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) + method=ESMF_REGRIDMETHOD_CONSERVE + fsrc = trim(dirout)//'/'//'Ct.mx'//trim(res)//'_SCRIP_land.nc' + fdst = trim(fv3dir)//'/'//trim(atmres)//'/'//trim(atmres)//'_mosaic.nc' + fwgt = trim(dirout)//'/'//'Ct.mx'//trim(res)//'.to.'//trim(atmres)//'.nc' + logmsg = 'creating weight file '//trim(fwgt) + print '(a)',trim(logmsg) - logmsg = 'creating mapped ocean mask for '//trim(atmres) - print '(a)',trim(logmsg) - call make_frac_land(trim(fsrc), trim(fwgt)) + call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & + weightFile=trim(fwgt), regridmethod=method, & + unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, ignoreDegenerate=.true., & + netcdf4fileFlag=.true., tileFilePath=trim(fv3dir)//'/'//trim(atmres)//'/', rc=rc) + if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & + line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) + + logmsg = 'creating mapped ocean mask for '//trim(atmres) + print '(a)',trim(logmsg) + call make_frac_land(trim(fsrc), trim(fwgt)) + end do !--------------------------------------------------------------------- ! use ESMF to create positional weights for mapping a field from its diff --git a/sorc/cpld_gridgen.fd/grdvars.F90 b/sorc/cpld_gridgen.fd/grdvars.F90 index 9c549a494..a3abad291 100644 --- a/sorc/cpld_gridgen.fd/grdvars.F90 +++ b/sorc/cpld_gridgen.fd/grdvars.F90 @@ -163,6 +163,9 @@ module grdvars !! rounded to minimum_depth real(kind=real_kind), parameter :: maximum_lat = 88.0 !< The maximum latitude for water points for WW3 + integer, parameter :: nar = 6 !< the number of possible ATM resolutions + integer, parameter, dimension(nar) :: catm = (/48, 96, 192, 384, 768, 1152/) !< the ATM resolutions for mapped ocean masks + contains !> Allocate grid variables !! diff --git a/sorc/cpld_gridgen.fd/inputnml.F90 b/sorc/cpld_gridgen.fd/inputnml.F90 index 96d86f4c3..f9adf1c4e 100644 --- a/sorc/cpld_gridgen.fd/inputnml.F90 +++ b/sorc/cpld_gridgen.fd/inputnml.F90 @@ -9,7 +9,7 @@ module inputnml use grdvars, only : nx,ny,ni,nj,npx use grdvars, only : editmask, debug, do_postwgts - use charstrings, only : dirsrc, dirout, fv3dir, res, atmres, topofile, editsfile + use charstrings, only : dirsrc, dirout, fv3dir, res, topofile, editsfile implicit none @@ -30,8 +30,7 @@ subroutine read_inputnml(fname) character(len=200) :: tmpstr namelist /grid_nml/ ni, nj, dirsrc, dirout, fv3dir, topofile, editsfile, & - res, atmres, npx, editmask, debug, & - do_postwgts + res, editmask, debug, do_postwgts ! Check whether file exists. inquire (file=trim(fname), iostat=rc) diff --git a/ush/cpld_gridgen.sh b/ush/cpld_gridgen.sh index e345c173b..9bb08109a 100755 --- a/ush/cpld_gridgen.sh +++ b/ush/cpld_gridgen.sh @@ -11,8 +11,6 @@ function edit_namelist { -e "s/TOPOGFILE/$TOPOGFILE/g" \ -e "s/EDITSFILE/$EDITSFILE/g" \ -e "s/RESNAME/$RESNAME/g" \ - -e "s/MOSAICRES/$MOSAICRES/g" \ - -e "s/NPX/$NPX/g" \ -e "s/DO_MASKEDIT/$MASKEDIT/g" \ -e "s/DO_DEBUG/$DEBUG/g" \ -e "s/DO_POSTWGTS/$DO_POSTWGTS/g" @@ -23,23 +21,6 @@ export DEBUG=.false. export MASKEDIT=.false. export DO_POSTWGTS=.true. export MOSAICDIR_PATH=${MOSAICDIR_PATH:-$PATHTR/fix/orog} -if [[ $MOSAICRES == C3072 ]]; then - export NPX=3072 -elif [[ $MOSAICRES == C1152 ]]; then - export NPX=1152 -elif [[ $MOSAICRES == C768 ]]; then - export NPX=768 -elif [[ $MOSAICRES == C384 ]]; then - export NPX=384 -elif [[ $MOSAICRES == C192 ]]; then - export NPX=192 -elif [[ $MOSAICRES == C096 ]]; then - export MOSAICRES=C96 - export NPX=96 -elif [[ $MOSAICRES == C048 ]]; then - export MOSAICRES=C48 - export NPX=48 -fi export FIXDIR_PATH=${MOM6_FIXDIR}/${RESNAME} APRUN=${APRUN:-"srun"}