diff --git a/sorc/cpld_gridgen.fd/charstrings.F90 b/sorc/cpld_gridgen.fd/charstrings.F90 index 00deab1b4..0e7b5a19b 100644 --- a/sorc/cpld_gridgen.fd/charstrings.F90 +++ b/sorc/cpld_gridgen.fd/charstrings.F90 @@ -15,7 +15,7 @@ module charstrings character(len=CL) :: dirout !< The directory where output files will be written character(len=CL) :: fv3dir !< The directory containing the FV3 mosaic files character(len=CS) :: res !< The Ocean/Ice resolution, e.g. 500 (5deg), 100 (1deg) - !! 050 (1/2deg), 025 (1/4deg) + !! 050 (1/2deg), 025 (1/4deg) character(len=CS) :: atmres !< The ATM resolution, e.g. C96, C192, C384 character(len=CL) :: logmsg !< An informational message diff --git a/sorc/cpld_gridgen.fd/postwgts.F90 b/sorc/cpld_gridgen.fd/postwgts.F90 index 4ff0bc0fa..dfa1c9616 100644 --- a/sorc/cpld_gridgen.fd/postwgts.F90 +++ b/sorc/cpld_gridgen.fd/postwgts.F90 @@ -29,6 +29,7 @@ subroutine make_postwgts character(len=CM), dimension(2) :: methodname = (/'conserve', 'bilinear'/) + type(ESMF_RouteHandle) :: rh type(ESMF_RegridMethod_Flag) :: method ! the number of possible destination grids depends on the source grid resolution integer :: k,rc,nd,ndest @@ -71,8 +72,8 @@ subroutine make_postwgts print '(a)',trim(logmsg) call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & - weightFile=trim(fwgt), regridmethod=method, & - ignoreDegenerate=.true., & + weightFile=trim(fwgt), regridmethod=method, & + ignoreDegenerate=.true., & unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) @@ -98,8 +99,8 @@ subroutine make_postwgts print '(a)',trim(logmsg) call ESMF_RegridWeightGen(srcFile=trim(fsrc),dstFile=trim(fdst), & - weightFile=trim(fwgt), regridmethod=method, & - ignoreDegenerate=.true., & + weightFile=trim(fwgt), regridmethod=method, & + ignoreDegenerate=.true., regridRouteHandle=rh, & unmappedaction=ESMF_UNMAPPEDACTION_IGNORE, rc=rc) if (ESMF_LogFoundError(rcToCheck=rc, msg=ESMF_LOGERR_PASSTHRU, & line=__LINE__, file=__FILE__)) call ESMF_Finalize(endflag=ESMF_END_ABORT) diff --git a/ush/cpld_gridgen.sh b/ush/cpld_gridgen.sh index a23d44a3d..abed8df3e 100755 --- a/ush/cpld_gridgen.sh +++ b/ush/cpld_gridgen.sh @@ -65,6 +65,9 @@ if [ $RESNAME = 100 ]; then if [ $DO_POSTWGTS == .true. ]; then #pre-generate SCRIP files for dst rectilinear grids using NCO ncremap -g ${OUTDIR_PATH}/rect.1p0_SCRIP.nc -G latlon=181,360#lon_typ=grn_ctr#lat_typ=cap + export FSRC=${OUTDIR_PATH}/rect.1p0_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.1p0_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 fi fi @@ -77,6 +80,12 @@ if [ $RESNAME = 050 ]; then #pre-generate SCRIP files for dst rectilinear grids using NCO ncremap -g ${OUTDIR_PATH}/rect.1p0_SCRIP.nc -G latlon=181,360#lon_typ=grn_ctr#lat_typ=cap ncremap -g ${OUTDIR_PATH}/rect.0p5_SCRIP.nc -G latlon=361,720#lon_typ=grn_ctr#lat_typ=cap + export FSRC=${OUTDIR_PATH}/rect.1p0_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.1p0_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 + export FSRC=${OUTDIR_PATH}/rect.0p5_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.0p5_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 fi fi @@ -90,6 +99,15 @@ if [ $RESNAME = 025 ]; then ncremap -g ${OUTDIR_PATH}/rect.1p0_SCRIP.nc -G latlon=181,360#lon_typ=grn_ctr#lat_typ=cap ncremap -g ${OUTDIR_PATH}/rect.0p5_SCRIP.nc -G latlon=361,720#lon_typ=grn_ctr#lat_typ=cap ncremap -g ${OUTDIR_PATH}/rect.0p25_SCRIP.nc -G latlon=721,1440#lon_typ=grn_ctr#lat_typ=cap + export FSRC=${OUTDIR_PATH}/rect.1p0_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.1p0_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 + export FSRC=${OUTDIR_PATH}/rect.0p5_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.0p5_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 + export FSRC=${OUTDIR_PATH}/rect.0p25_SCRIP.nc + export FDST=${OUTDIR_PATH}/rect.0p25_mesh.nc + $APRUN -n 1 ESMF_Scrip2Unstruct ${FSRC} ${FDST} 0 fi fi