From feb0a484e52b93682ec44a0c55421db528c22044 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Wed, 25 Oct 2023 08:05:58 -0400 Subject: [PATCH 1/2] update mom6 fix directory across platforms --- reg_tests/cpld_gridgen/rt.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/reg_tests/cpld_gridgen/rt.sh b/reg_tests/cpld_gridgen/rt.sh index b08cbac7c..bf5ab16c9 100755 --- a/reg_tests/cpld_gridgen/rt.sh +++ b/reg_tests/cpld_gridgen/rt.sh @@ -125,7 +125,7 @@ rm -f fail_test* $COMPILE_LOG run_*.log nccmp_*.log summary.log if [[ $target = wcoss2 ]]; then STMP=${STMP:-/lfs/h2/emc/stmp/$USER} - export MOM6_FIXDIR=/lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/fix_mom6 + export MOM6_FIXDIR=/lfs/h2/emc/global/noscrub/emc.global/FIX/fix/mom6/20220805 BASELINE_ROOT=/lfs/h2/emc/nems/noscrub/emc.nems/UFS_UTILS/reg_tests/cpld_gridgen/baseline_data ACCOUNT=${ACCOUNT:-GFS-DEV} export APRUN="mpiexec -n 1 -ppn 1 --cpu-bind core" @@ -134,7 +134,7 @@ if [[ $target = wcoss2 ]]; then NCCMP=/lfs/h2/emc/global/noscrub/George.Gayno/util/nccmp/nccmp-1.8.5.0/src/nccmp elif [[ $target = hera ]]; then STMP=${STMP:-/scratch1/NCEPDEV/stmp4/$USER} - export MOM6_FIXDIR=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/fix_mom6 + export MOM6_FIXDIR=/scratch1/NCEPDEV/global/glopara/fix/mom6/20220805 BASELINE_ROOT=/scratch1/NCEPDEV/nems/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data ACCOUNT=${ACCOUNT:-nems} QUEUE=${QUEUE:-batch} @@ -143,7 +143,7 @@ elif [[ $target = hera ]]; then SBATCH_COMMAND="./cpld_gridgen.sh" elif [[ $target = orion ]]; then STMP=${STMP:-/work/noaa/stmp/$USER} - export MOM6_FIXDIR=/work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/fix_mom6 + export MOM6_FIXDIR=/work/noaa/global/glopara/fix/mom6/20220805 BASELINE_ROOT=/work/noaa/nems/role-nems/ufs_utils/reg_tests/cpld_gridgen/baseline_data ACCOUNT=${ACCOUNT:-nems} QUEUE=${QUEUE:-batch} @@ -153,7 +153,7 @@ elif [[ $target = orion ]]; then SBATCH_COMMAND="./cpld_gridgen.sh" elif [[ $target = jet ]]; then STMP=${STMP:-/lfs4/HFIP/h-nems/$USER} - export MOM6_FIXDIR=/lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/fix_mom6 + export MOM6_FIXDIR=/lfs4/HFIP/hfv3gfs/glopara/git/fv3gfs/fix/mom6/20220805 BASELINE_ROOT=/lfs4/HFIP/hfv3gfs/emc.nemspara/role.ufsutils/ufs_utils/reg_tests/cpld_gridgen/baseline_data ACCOUNT=${ACCOUNT:-h-nems} QUEUE=${QUEUE:-batch} From 68825be5452a8e1d89a5b8f91d66a1efce6e991c Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Wed, 25 Oct 2023 16:34:36 +0000 Subject: [PATCH 2/2] add aborts for when required files are not present --- sorc/cpld_gridgen.fd/gen_fixgrid.F90 | 32 +++++++++++++++++++++------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 index 2fcffb126..36f118eed 100644 --- a/sorc/cpld_gridgen.fd/gen_fixgrid.F90 +++ b/sorc/cpld_gridgen.fd/gen_fixgrid.F90 @@ -169,17 +169,22 @@ program gen_fixgrid if(xtype.eq. 6)dp4 = real(dp8,4) - !print *,minval(dp8),maxval(dp8) - !print *,minval(dp4),maxval(dp4) - if(editmask)then !--------------------------------------------------------------------- - ! apply topoedits run time mask changes if required for this config + ! apply topoedits run time mask changes if required for this config + ! this will create a modified topoedits file which accounts for any + ! land mask changes created at run time by MOM6 !--------------------------------------------------------------------- if(trim(editsfile) == 'none')then print '(a)', 'Need a valid editsfile to make mask edits ' - stop + call abort() + end if + inquire(file=trim(dirsrc)//'/'//trim(editsfile),exist=fexist) + if (.not. fexist) then + print '(a)', 'Required topoedits file '//trim(editsfile) & + //'for land mask changes is missing ' + call abort() end if fsrc = trim(dirsrc)//'/'//trim(editsfile) @@ -191,11 +196,22 @@ program gen_fixgrid ! MOM6 reads the depth file, applies the topo edits and then adjusts ! depth using masking_depth and min/max depth. This call mimics ! MOM6 routines apply_topography_edits_from_file and limit_topography + ! If the the topoedits file has been modified to account for MOM6 run + ! time land mask changes (above), then the depth will be created using + ! this modified topoedits file !--------------------------------------------------------------------- - fsrc = trim(dirsrc)//'/'//trim(editsfile) - if(editmask)fsrc = trim(dirout)//'/'//'ufs.'//trim(editsfile) - call apply_topoedits(fsrc) + fsrc = trim(dirsrc)//'/'//trim(editsfile) + if(editmask)fsrc = trim(dirout)//'/'//'ufs.'//trim(editsfile) + + if (trim(editsfile) /= 'none') then + inquire(file=trim(fsrc),exist=fexist) + if (.not. fexist) then + print '(a)', 'Required topoedits file '//trim(fsrc)//' is missing ' + call abort() + end if + end if + call apply_topoedits(fsrc) !--------------------------------------------------------------------- ! read MOM6 supergrid file