Skip to content

Commit

Permalink
feature/regional_grid This commit references NOAA-EMC#4
Browse files Browse the repository at this point in the history
Rename gfdl regional flag to be 'regional_gfdl' in all
scripts.
  • Loading branch information
GeorgeGayno-NOAA committed Jul 2, 2020
1 parent bdfe3f6 commit 03ff906
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 46 deletions.
20 changes: 13 additions & 7 deletions driver_scripts/driver_grid.cray.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@
# "uniform" - global uniform grid
# "stretch" - global stretched grid
# "nest" - global stretched grid with nest
# "regional" - stand-alone regional grid
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnominic
# (esg) regional grid
# 3) 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",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional" grids, set the "halo". Default is three
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) Set working directory - TMPDIR - and path to the repository
# 6) 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
# clone - home_dir.
# 7) Submit script: "cat $script | bsub".
# 8) All files will be placed in "out_dir".
# 8) Submit script: "cat $script | bsub".
# 9) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -57,7 +62,8 @@ module list
# Set grid specs here.
#-----------------------------------------------------------------------

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

if [ $gtype = uniform ]; then
export res=96
Expand All @@ -66,7 +72,7 @@ elif [ $gtype = stretch ]; then
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
elif [ $gtype = nest ] || [ $gtype = regional ]; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
Expand Down
20 changes: 13 additions & 7 deletions driver_scripts/driver_grid.dell.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,24 @@
# "uniform" - global uniform grid
# "stretch" - global stretched grid
# "nest" - global stretched grid with nest
# "regional" - stand-alone regional grid
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnominic
# (esg) regional grid
# 3) 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",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional" grids, set the "halo". Default is three
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) Set working directory - TMPDIR - and path to the repository
# 6) 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
# clone - home_dir.
# 7) Submit script: "cat $script | bsub".
# 8) All files will be placed in "out_dir".
# 8) Submit script: "cat $script | bsub".
# 9) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -59,7 +64,8 @@ module list
# Set grid specs here.
#-----------------------------------------------------------------------

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

if [ $gtype = uniform ]; then
export res=96
Expand All @@ -68,7 +74,7 @@ elif [ $gtype = stretch ]; then
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
elif [ $gtype = nest ] || [ $gtype = regional ]; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
Expand Down
20 changes: 13 additions & 7 deletions driver_scripts/driver_grid.hera.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,24 @@
# "uniform" - global uniform grid
# "stretch" - global stretched grid
# "nest" - global stretched grid with nest
# "regional" - stand-alone regional grid
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnominic
# (esg) regional grid
# 3) 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",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional" grids, set the "halo". Default is three
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) Set working directory - TMPDIR - and path to the repository
# 6) 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
# clone - home_dir.
# 7) Submit script: "sbatch $script".
# 8) All files will be placed in "out_dir".
# 8) Submit script: "sbatch $script".
# 9) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -59,7 +64,8 @@ module list
# Set grid specs here.
#-----------------------------------------------------------------------

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

if [ $gtype = uniform ]; then
export res=96
Expand All @@ -68,7 +74,7 @@ elif [ $gtype = stretch ]; then
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
elif [ $gtype = nest ] || [ $gtype = regional ]; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
Expand Down
20 changes: 13 additions & 7 deletions driver_scripts/driver_grid.jet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,24 @@
# "uniform" - global uniform grid
# "stretch" - global stretched grid
# "nest" - global stretched grid with nest
# "regional" - stand-alone regional grid
# "regional_gfdl" - stand-alone gfdl regional grid
# "regional_esg" - stand-alone extended Schmidt gnominic
# (esg) regional grid
# 3) 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",
# the starting/ending i/j index location within the parent
# tile - "istart_nest", "jstart_nest", "iend_nest", "jend_nest"
# 5) For "regional" grids, set the "halo". Default is three
# 5) For "regional_gfdl" grids, set the "halo". Default is three
# rows/columns.
# 6) Set working directory - TMPDIR - and path to the repository
# 6) 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
# clone - home_dir.
# 7) Submit script: "sbatch $script".
# 8) All files will be placed in "out_dir".
# 8) Submit script: "sbatch $script".
# 9) All files will be placed in "out_dir".
#
#-----------------------------------------------------------------------

Expand All @@ -60,7 +65,8 @@ module list
# Set grid specs here.
#-----------------------------------------------------------------------

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

if [ $gtype = uniform ]; then
export res=96
Expand All @@ -69,7 +75,7 @@ elif [ $gtype = stretch ]; then
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
export target_lat=35.5 # Center latitude of the highest resolution tile
elif [ $gtype = nest ] || [ $gtype = regional ]; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ]; then
export res=96
export stretch_fac=1.5 # Stretching factor for the grid
export target_lon=-97.5 # Center longitude of the highest resolution tile
Expand Down
23 changes: 13 additions & 10 deletions ush/fv3gfs_driver_grid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# 1) global uniform
# 2) global stretched
# 3) global stretched with nest
# 4) stand-alone regional
# 4) stand-alone GFDL regional
# 5) stand-alone extended Schmidt gnonomic (ESG) regional
#
# Produces the following files (netcdf, each tile in separate file):
# 1) 'mosaic' and 'grid' files containing lat/lon and other
Expand Down Expand Up @@ -41,7 +42,8 @@ export machine=${machine:?}
#----------------------------------------------------------------------------------

export res=${res:-96} # resolution of tile: 48, 96, 128, 192, 384, 768, 1152, 3072
export gtype=${gtype:-uniform} # grid type: uniform, stretch, nest or regional
export gtype=${gtype:-uniform} # grid type: uniform, stretch, nest, regional_gfdl
# or regional_esg

if [ $gtype = uniform ]; then
echo "Creating global uniform grid"
Expand All @@ -51,7 +53,7 @@ elif [ $gtype = stretch ]; then
export target_lat=${target_lat:-35.5} # Center latitude of the highest resolution tile
title=c${res}s
echo "Creating global stretched grid"
elif [ $gtype = nest ] || [ $gtype = regional ]; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ]; then
export stretch_fac=${stretch_fac:-1.5} # Stretching factor for the grid
export target_lon=${target_lon:--97.5} # Center longitude of the highest resolution tile
export target_lat=${target_lat:-35.5} # Center latitude of the highest resolution tile
Expand All @@ -65,9 +67,10 @@ elif [ $gtype = nest ] || [ $gtype = regional ]; then
if [ $gtype = nest ];then
echo "Creating global nested grid"
else
echo "Creating regional grid"
echo "Creating gfdl regional grid"
fi
elif [ $gtype = regional_esg ]; then
echo "Creating esg regional grid"
export target_lon=${target_lon:--97.5} # Center longitude of grid
export target_lat=${target_lat:-35.5} # Center latitude of grid
export idim=${idim:-200} # Dimension of grid in 'i' direction
Expand All @@ -81,7 +84,7 @@ elif [ $gtype = regional_esg ]; then
export halo=${halo:-3} # Number of rows/cols for halo.
title=esg
else
echo "Error: please specify grid type with 'gtype' as uniform, stretch, nest or regional"
echo "Error: please specify grid type with 'gtype' as uniform, stretch, nest, regional_gfdl or regional_esg"
exit 9
fi

Expand Down Expand Up @@ -227,11 +230,11 @@ if [ $gtype = uniform ] || [ $gtype = stretch ] || [ $gtype = nest ]; then

#----------------------------------------------------------------------------------
#----------------------------------------------------------------------------------
# Regional grid.
# Regional grid (gfdl or esg)
#----------------------------------------------------------------------------------
#----------------------------------------------------------------------------------

elif [ $gtype = regional ] || [ $gtype = regional_esg ]; then
elif [ $gtype = regional_gfdl ] || [ $gtype = regional_esg ]; then

#----------------------------------------------------------------------------------
# We are now creating only 1 tile and it is tile 7
Expand All @@ -251,7 +254,7 @@ elif [ $gtype = regional ] || [ $gtype = regional_esg ]; then
# Create regional gfdl grid files.
#----------------------------------------------------------------------------------

if [ $gtype = regional ]; then
if [ $gtype = regional_gfdl ]; then

set +x # don't echo all the computation to figure out how many points to add/subtract from start/end nest values

Expand Down Expand Up @@ -444,7 +447,7 @@ export BASE_DIR=$home_dir
export FIX_FV3=$out_dir
export input_sfc_climo_dir=$home_dir/fix/fix_sfc_climo

if [ $gtype = regional ] || [ $gtype = regional_esg ]; then
if [ $gtype = regional_gfdl ] || [ $gtype = regional_esg ]; then
export HALO=$halop1
ln -fs $out_dir/C${res}_grid.tile${tile}.halo${HALO}.nc $out_dir/C${res}_grid.tile${tile}.nc
ln -fs $out_dir/C${res}_oro_data.tile${tile}.halo${HALO}.nc $out_dir/C${res}_oro_data.tile${tile}.nc
Expand All @@ -460,7 +463,7 @@ if [ $err != 0 ]; then
exit $err
fi

if [ $gtype = regional ] || [ $gtype = regional_esg ]; then
if [ $gtype = regional_gfdl ] || [ $gtype = regional_esg ]; then
rm -f $out_dir/C${res}_grid.tile${tile}.nc
rm -f $out_dir/C${res}_oro_data.tile${tile}.nc
fi
Expand Down
4 changes: 2 additions & 2 deletions ush/fv3gfs_filter_topo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ if [ $# -ne 4 ]; then
exit 1
fi

if [ $gtype = stretch ] || [ $gtype = regional ]; then
if [ $gtype = stretch ] || [ $gtype = regional_gfdl ]; then
stretch=$stretch_fac
else
stretch=1.0
Expand Down Expand Up @@ -53,7 +53,7 @@ cp $orodir/${topo_file}.tile?.nc .
cp $executable .

regional=.false.
if [ $gtype = regional ] || [ $gtype = regional_esg ] ; then
if [ $gtype = regional_gfdl ] || [ $gtype = regional_esg ] ; then
regional=.true.
fi

Expand Down
12 changes: 6 additions & 6 deletions ush/fv3gfs_make_grid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set -ax
# APRUN Command to invoke executables
# exec_dir Location of executables
# gtype Grid type. 'uniform' - global uniform; 'stretch' - global
# stretched; 'nest' - global stretched with nest; 'regional' -
# stretched; 'nest' - global stretched with nest; 'regional_gfdl' -
# stand alone GFDL regional nest; 'regional_esg' - stand alone
# extended Schmidt gnomonic regional grid.
# halo Lateral boundary halo size, regional grids only.
Expand Down Expand Up @@ -85,7 +85,7 @@ elif [ $gtype = stretch ]; then
ntiles=6
$APRUN $executable --grid_type gnomonic_ed --nlon $nx --grid_name C${res}_grid \
--do_schmidt --stretch_factor ${stretch_fac} --target_lon ${target_lon} --target_lat ${target_lat}
elif [ $gtype = nest ] || [ $gtype = regional ] ; then
elif [ $gtype = nest ] || [ $gtype = regional_gfdl ] ; then
stretch_fac=${stretch_fac:?}
target_lon=${target_lon:?}
target_lat=${target_lat:?}
Expand All @@ -95,7 +95,7 @@ elif [ $gtype = nest ] || [ $gtype = regional ] ; then
iend_nest=$4
jend_nest=$5
halo=${halo:?}
if [ $gtype = regional ]; then
if [ $gtype = regional_gfdl ]; then
ntiles=1
else
ntiles=7
Expand Down Expand Up @@ -143,7 +143,7 @@ fi
# Below, this attribute is retrieved and used to rename the grid files.
#---------------------------------------------------------------------------------------

if [ $gtype = regional ] || [ $gtype = regional_esg ]; then
if [ $gtype = regional_gfdl ] || [ $gtype = regional_esg ]; then
executable=$exec_dir/global_equiv_resol
if [ ! -s $executable ]; then
set +x
Expand All @@ -155,7 +155,7 @@ if [ $gtype = regional ] || [ $gtype = regional_esg ]; then
fi
if [ $gtype = regional_esg ]; then
$APRUN $executable regional_grid.nc
elif [ $gtype = regional ]; then
elif [ $gtype = regional_gfdl ]; then
$APRUN $executable C${res}_grid.tile7.nc
fi
if [ $? -ne 0 ]; then
Expand Down Expand Up @@ -206,7 +206,7 @@ elif [ $gtype = nest ]; then

$APRUN $executable --num_tiles 1 --dir $outdir --mosaic C${res}_nested_mosaic --tile_file C${res}_grid.tile7.nc

elif [ $gtype = regional ];then
elif [ $gtype = regional_gfdl ];then

res_save=$res
get_res C${res}_grid.tile7.nc
Expand Down

0 comments on commit 03ff906

Please sign in to comment.