Skip to content

Commit

Permalink
Merge branch 'feature/gw-mom6dir' into feature/fixpostwts
Browse files Browse the repository at this point in the history
  • Loading branch information
DeniseWorthen committed Oct 25, 2023
2 parents 52c3634 + 68825be commit 783536b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 12 deletions.
8 changes: 4 additions & 4 deletions reg_tests/cpld_gridgen/rt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down
32 changes: 24 additions & 8 deletions sorc/cpld_gridgen.fd/gen_fixgrid.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit 783536b

Please sign in to comment.