Skip to content

Commit

Permalink
Add lake-maker to grid generation process
Browse files Browse the repository at this point in the history
Adding the lake maker from Shan Sun and Ning Wang: generate lake fraction and depth on
the FV3 grid and add these records to the orography files. Ensure land fraction and lake 
fraction are consistent.  For details, see issue #111
  • Loading branch information
GeorgeGayno-NOAA authored Sep 3, 2020
1 parent d2fab36 commit 7770042
Show file tree
Hide file tree
Showing 24 changed files with 1,901 additions and 47 deletions.
26 changes: 18 additions & 8 deletions driver_scripts/driver_grid.cray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnomonic
# (esg) regional grid
# 3) For "stretch" and "nest" grids, set the stretching factor -
# 3) For "uniform" grids - to include lake fraction and
# depth, set "add_lake" to true, and the "lake_cutoff" value.
# 4) For "stretch" and "nest" grids, set the stretching factor -
# "stretch_fac", and center lat/lon of highest resolution
# tile - "target_lat" and "target_lon".
# 4) For "nest" grids, set the refinement ratio - "refine_ratio",
# 5) For "nest" grids, set the refinement ratio - "refine_ratio",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# 6) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) For "regional_esg" grids, set center lat/lon of grid,
# 7) For "regional_esg" grids, set center lat/lon of grid,
# - "target_lat/lon" - the i/j dimensions - "i/jdim", the
# x/y grid spacing - "delx/y", and halo.
# 7) Set working directory - TMPDIR - and path to the repository
# 8) Set working directory - TMPDIR - and path to the repository
# clone - home_dir.
# 8) Submit script: "cat $script | bsub".
# 9) All files will be placed in "out_dir".
# 9) Submit script: "cat $script | bsub".
# 10) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -62,11 +64,14 @@ module list
# Set grid specs here.
#-----------------------------------------------------------------------

export gtype=uniform # 'uniform', 'stretch', 'nest'
export gtype=uniform # 'uniform', 'stretch', 'nest'
# 'regional_gfdl', 'regional_esg'

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
# Uniform grids only.
export lake_cutoff=0.20 # lake frac less than lake_cutoff is ignored
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down Expand Up @@ -109,6 +114,10 @@ export home_dir=$LS_SUBCWD/..
export TMPDIR=/gpfs/hps3/stmp/$LOGNAME/fv3_grid.$gtype
export out_dir=/gpfs/hps3/stmp/$LOGNAME/my_grids

#-----------------------------------------------------------------------
# Should not need to change anything below here.
#-----------------------------------------------------------------------

export NODES=1
export APRUN="aprun -n 1 -N 1 -j 1 -d 1 -cc depth"
export APRUN_SFC="aprun -j 1 -n 24 -N 24"
Expand All @@ -117,6 +126,7 @@ export OMP_NUM_THREADS=6
export OMP_STACKSIZE=2048m
export KMP_AFFINITY=disabled
export machine=WCOSS_C
export NCDUMP=/gpfs/hps/usrx/local/prod/NetCDF/4.2/intel/sandybridge/bin/ncdump

ulimit -a
ulimit -s unlimited
Expand Down
21 changes: 13 additions & 8 deletions driver_scripts/driver_grid.dell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,23 @@
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnomonic
# (esg) regional grid
# 3) For "stretch" and "nest" grids, set the stretching factor -
# 3) For "uniform" grids - to include lake fraction and
# depth, set "add_lake" to true, and the "lake_cutoff" value.
# 4) For "stretch" and "nest" grids, set the stretching factor -
# "stretch_fac", and center lat/lon of highest resolution
# tile - "target_lat" and "target_lon".
# 4) For "nest" grids, set the refinement ratio - "refine_ratio",
# 5) For "nest" grids, set the refinement ratio - "refine_ratio",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# 6) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) For "regional_esg" grids, set center lat/lon of grid,
# 7) For "regional_esg" grids, set center lat/lon of grid,
# - "target_lat/lon" - the i/j dimensions - "i/jdim", the
# x/y grid spacing - "delx/y", and halo.
# 7) Set working directory - TMPDIR - and path to the repository
# 8) Set working directory - TMPDIR - and path to the repository
# clone - home_dir.
# 8) Submit script: "cat $script | bsub".
# 9) All files will be placed in "out_dir".
# 9) Submit script: "cat $script | bsub".
# 10) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -65,10 +67,13 @@ module list
#-----------------------------------------------------------------------

export gtype=uniform # 'uniform', 'stretch', 'nest',
# 'regional_gfdl', 'regional_esg'
# 'regional_gfdl', 'regional_esg'

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
# Uniform grids only.
export lake_cutoff=0.20 # lake frac less than lake_cutoff is ignored
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
19 changes: 12 additions & 7 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnomonic
# (esg) regional grid
# 3) For "stretch" and "nest" grids, set the stretching factor -
# 3) For "uniform" grids - to include lake fraction and
# depth, set "add_lake" to true, and the "lake_cutoff" value.
# 4) For "stretch" and "nest" grids, set the stretching factor -
# "stretch_fac", and center lat/lon of highest resolution
# tile - "target_lat" and "target_lon".
# 4) For "nest" grids, set the refinement ratio - "refine_ratio",
# 5) For "nest" grids, set the refinement ratio - "refine_ratio",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# 6) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) For "regional_esg" grids, set center lat/lon of grid,
# 7) For "regional_esg" grids, set center lat/lon of grid,
# - "target_lat/lon" - the i/j dimensions - "i/jdim", the
# x/y grid spacing - "delx/y", and halo.
# 7) Set working directory - TMPDIR - and path to the repository
# 8) Set working directory - TMPDIR - and path to the repository
# clone - home_dir.
# 8) Submit script: "sbatch $script".
# 9) All files will be placed in "out_dir".
# 9) Submit script: "sbatch $script".
# 10) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -69,6 +71,9 @@ export gtype=uniform # 'uniform', 'stretch', 'nest'

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
# Uniform grids only.
export lake_cutoff=0.20 # lake frac less than lake_cutoff is ignored
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
19 changes: 12 additions & 7 deletions driver_scripts/driver_grid.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,23 @@
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnomonic
# (esg) regional grid
# 3) For "stretch" and "nest" grids, set the stretching factor -
# 3) For "uniform" grids - to include lake fraction and
# depth, set "add_lake" to true, and the "lake_cutoff" value.
# 4) For "stretch" and "nest" grids, set the stretching factor -
# "stretch_fac", and center lat/lon of highest resolution
# tile - "target_lat" and "target_lon".
# 4) For "nest" grids, set the refinement ratio - "refine_ratio",
# 5) For "nest" grids, set the refinement ratio - "refine_ratio",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# 6) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) For "regional_esg" grids, set center lat/lon of grid,
# 7) For "regional_esg" grids, set center lat/lon of grid,
# - "target_lat/lon" - the i/j dimensions - "i/jdim", the
# x/y grid spacing - "delx/y", and halo.
# 7) Set working directory - TMPDIR - and path to the repository
# 8) Set working directory - TMPDIR - and path to the repository
# clone - home_dir.
# 8) Submit script: "sbatch $script".
# 9) All files will be placed in "out_dir".
# 9) Submit script: "sbatch $script".
# 10) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -70,6 +72,9 @@ export gtype=uniform # 'uniform', 'stretch', 'nest'

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
# Uniform grids only.
export lake_cutoff=0.20 # lake frac less than lake_cutoff is ignored
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
19 changes: 12 additions & 7 deletions driver_scripts/driver_grid.orion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt
# gnomonic (esg) regional grid
# 3) For "stretch" and "nest" grids, set the stretching factor -
# 3) For "uniform" grids - to include lake fraction and
# depth, set "add_lake" to true, and the "lake_cutoff" value.
# 4) For "stretch" and "nest" grids, set the stretching factor -
# "stretch_fac", and center lat/lon of highest resolution
# tile - "target_lat" and "target_lon".
# 4) For "nest" grids, set the refinement ratio - "refine_ratio",
# 5) For "nest" grids, set the refinement ratio - "refine_ratio",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# 6) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) For "regional_esg" grids, set center lat/lon of grid,
# 7) For "regional_esg" grids, set center lat/lon of grid,
# - "target_lat/lon" - the i/j dimensions - "i/jdim", the
# x/y grid spacing - "delx/y", and halo.
# 7) Set working directory - TMPDIR - and path to the repository
# 8) Set working directory - TMPDIR - and path to the repository
# clone - home_dir.
# 8) Submit script: "sbatch $script".
# 9) All files will be placed in "out_dir".
# 9) Submit script: "sbatch $script".
# 10) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -69,6 +71,9 @@ export gtype=uniform # 'uniform', 'stretch', 'nest',

if [ $gtype = uniform ]; then
export res=96
export add_lake=false # Add lake frac and depth to orography data.
# Uniform grids only.
export lake_cutoff=0.20 # lake frac less than lake_cutoff is ignored
elif [ $gtype = stretch ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
Expand Down
4 changes: 3 additions & 1 deletion sorc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ add_subdirectory(mkgfsnemsioctl.fd)
add_subdirectory(fre-nctools.fd)
add_subdirectory(grid_tools.fd)
add_subdirectory(chgres_cube.fd)
add_subdirectory(orog.fd)
add_subdirectory(orog_mask_tools.fd/orog.fd)
add_subdirectory(orog_mask_tools.fd/lake.fd)
add_subdirectory(orog_mask_tools.fd/inland.fd)
add_subdirectory(sfc_climo_gen.fd)
19 changes: 19 additions & 0 deletions sorc/orog_mask_tools.fd/inland.fd/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
set(fortran_src
nb.F90
inland.F90)

if(CMAKE_Fortran_COMPILER_ID MATCHES "^(Intel)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -assume byterecl")
elseif(CMAKE_Fortran_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$")
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fno-range-check")
endif()

set(exe_name inland)

add_executable(${exe_name} ${fortran_src})

target_link_libraries(
${exe_name}
NetCDF::NetCDF_Fortran)

install(TARGETS ${exe_name} RUNTIME DESTINATION ${exec_dir})
Loading

0 comments on commit 7770042

Please sign in to comment.