Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run sfc_climo_gen utility on Hera #791

Merged
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions util/sfc_climo_gen/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ Run the sfc_climo_gen program stand-alone on WCOSS2 using
pre-exiting 'grid' and 'orography' files.

Outputs surface fields such as soil and vegetation type.

Set the configuration variables in sfc_gen.sh. Then
run using the machine specific driver script.
29 changes: 29 additions & 0 deletions util/sfc_climo_gen/run.hera.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/bash

#------------------------------------------------------------
# Run the sfc_climo_gen program stand-alone on Hera using
# pre-exiting 'grid' and 'orography files.
#
# Set the configuration variables in sfc_gen.sh. Then
# run this script as follows: 'sbatch $script'
#------------------------------------------------------------

#SBATCH -J sfc_climo_gen
#SBATCH -A fv3-cpu
#SBATCH --open-mode=truncate
#SBATCH -o log
#SBATCH -e log
#SBATCH --nodes=1 --ntasks-per-node=24
#SBATCH --partition=bigmem
#SBATCH -q debug
#SBATCH -t 00:10:00

set -x

export APRUN_SFC="srun"

export BASE_DIR=$SLURM_SUBMIT_DIR/../..

$SLURM_SUBMIT_DIR/sfc_gen.sh

exit
87 changes: 3 additions & 84 deletions util/sfc_climo_gen/run.wcoss2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
# Run the sfc_climo_gen program stand-alone on WCOSS2 using
# pre-exiting 'grid' and 'orography files.
#
# To run, type: 'qsub $script'
# Set the configuration variables in sfc_gen.sh. Then,
# run this script as follows: 'qsub $script'
#------------------------------------------------------------

#PBS -o log
Expand All @@ -22,88 +23,6 @@ export APRUN_SFC="mpiexec -n 24 -ppn 24 -cpu-bind core"

export BASE_DIR=$PBS_O_WORKDIR/../..

source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1
module use ${BASE_DIR}/modulefiles
module load build.$target.intel
module list

#-------------------------------------
# Set model resolution.
#-------------------------------------

export res=384

#-------------------------------------
# Where the model "grid", "mosaic" and "oro" files reside.
#-------------------------------------

export FIX_FV3=${BASE_DIR}/fix/orog/C${res}

#-------------------------------------
# Uncomment for regional grids.
#-------------------------------------

##HALO=3
##export GRIDTYPE=regional

#-------------------------------------------------------------
# Choose which soil type and vegetation type data to use.
#
# For viirs-based vegetation type data, set to:
# 1) "viirs.igbp.0.1" for global 0.10-deg data
# 2) "viirs.igbp.0.05" for global 0.05-deg data
# 3) "viirs.igbp.0.03" for global 0.03-deg data
# 4) "viirs.igbp.conus.30s" for CONUS 30s data
# 4) "viirs.igbp.nh.30s" for NH 30s data
# 4) "viirs.igbp.30s" for global 30s data
#
# For the modis-based vegetation data, set to:
# 1) "modis.igbp.0.05" for global 0.05-deg data
# 2) "modis.igbp.0.03" for global 0.03-deg data
# 3) "modis.igbp.conus.30s" for CONUS 30s data
# 4) "modis.igbp.nh.30s" for NH 30s data
# 5) "modis.igbp.30s" for global 30s data
#
# For STATSGO soil type data
# 1) "statsgo.0.05" for global 0.05-deg data
# 2) "statsgo.0.03" for global 0.03-deg data
# 3) "statsgo.conus.30s" for CONUS 30s data
# 4) "statsgo.nh.30s" for NH 30s data
# 5) "statsgo.30s" for global 30s data
#
# For Beijing Norm. Univ. soil type data
# 1) "bnu.30s" for global 30s data
#-------------------------------------------------------------

export veg_type_src="modis.igbp.0.05"

export soil_type_src="statsgo.0.05"

#-------------------------------------
# Set working directory and directory where output files will be saved.
#-------------------------------------

export WORK_DIR=/lfs/h2/emc/stmp/$LOGNAME/work.sfc
export SAVE_DIR=/lfs/h2/emc/stmp/$LOGNAME/sfc.C${res}

#-------------------------------------
# Should not have to touch anything below here.
#-------------------------------------

if [[ $GRIDTYPE = "regional" ]]; then
HALO=$(( $HALO + 1 ))
export HALO
ln -fs $FIX_FV3/C${res}_grid.tile7.halo${HALO}.nc $FIX_FV3/C${res}_grid.tile7.nc
ln -fs $FIX_FV3/C${res}_oro_data.tile7.halo${HALO}.nc $FIX_FV3/C${res}_oro_data.tile7.nc
fi

export input_sfc_climo_dir=${BASE_DIR}/fix/sfc_climo

ulimit -a
ulimit -s unlimited

rm -fr $WORK_DIR $SAVE_DIR

${BASE_DIR}/ush/sfc_climo_gen.sh
$PBS_O_WORKDIR/sfc_gen.sh

exit
94 changes: 94 additions & 0 deletions util/sfc_climo_gen/sfc_gen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
#!/bin/bash

#-----------------------------------------------------------------------
#
# This script is run by the machine specific driver script.
#
# Set the following variables:
#
# res - Grid resolution. Example: 384 or 384.mx025.
#
# GRIDTYPE - set to 'regional' for regional grids. Otherwise,
# comment out.
#
# HALO - The number of halo rows/cols. Only for regional grids.
# Otherwise, comment out.
#
# WORK_DIR - Working directory.
#
# SAVE_DIR - Directory where the surface files will be saved.
#
# veg_type_src - Input vegetation type data. Choices are:
# For viirs-based vegetation type data, set to:
# - "viirs.igbp.0.1" for global 0.10-deg data
# - "viirs.igbp.0.05" for global 0.05-deg data
# - "viirs.igbp.0.03" for global 0.03-deg data
# - "viirs.igbp.conus.30s" for CONUS 30s data
# - "viirs.igbp.nh.30s" for NH 30s data
# - "viirs.igbp.30s" for global 30s data
# For the modis-based vegetation data, set to:
# - "modis.igbp.0.05" for global 0.05-deg data
# - "modis.igbp.0.03" for global 0.03-deg data
# - "modis.igbp.conus.30s" for CONUS 30s data
# - "modis.igbp.nh.30s" for NH 30s data
# - "modis.igbp.30s" for global 30s data
#
# soil_type_src - Input soil type data. Choices are:
# For STATSGO soil type data
# - "statsgo.0.05" for global 0.05-deg data
# - "statsgo.0.03" for global 0.03-deg data
# - "statsgo.conus.30s" for CONUS 30s data
# - "statsgo.nh.30s" for NH 30s data
# - "statsgo.30s" for global 30s data
# For Beijing Norm. Univ. soil type data
# - "bnu.30s" for global 30s data
#-----------------------------------------------------------------------

#export res=384
export res=384.mx025

##HALO=3
##export GRIDTYPE=regional

export veg_type_src="modis.igbp.0.05"

export soil_type_src="statsgo.0.05"

export WORK_DIR=/lfs/h2/emc/stmp/$LOGNAME/work.sfc
export SAVE_DIR=/lfs/h2/emc/stmp/$LOGNAME/sfc.C${res}

#------------------------------------------------------------------------
#------------------------------------------------------------------------
# Should not have to touch anything below here.
#------------------------------------------------------------------------
#------------------------------------------------------------------------

export FIX_FV3=${BASE_DIR}/fix/orog/C${res}

if [[ $GRIDTYPE = "regional" ]]; then
HALO=$(( $HALO + 1 ))
export HALO
ln -fs $FIX_FV3/C${res}_grid.tile7.halo${HALO}.nc $FIX_FV3/C${res}_grid.tile7.nc
ln -fs $FIX_FV3/C${res}_oro_data.tile7.halo${HALO}.nc $FIX_FV3/C${res}_oro_data.tile7.nc
fi

res2=${res//".mx"*}
export mosaic_file=$FIX_FV3/C${res2}_mosaic.nc

export input_sfc_climo_dir=${BASE_DIR}/fix/sfc_climo

ulimit -a
ulimit -s unlimited

source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1
module use ${BASE_DIR}/modulefiles
module load build.$target.intel
module list

rm -fr $WORK_DIR $SAVE_DIR

export APRUN

${BASE_DIR}/ush/sfc_climo_gen.sh

exit