Skip to content

Commit d9c6830

Browse files
Merge branch 'develop' into release/1.10
Fixes #796.
2 parents f120115 + ebbe14b commit d9c6830

File tree

4 files changed

+167
-92
lines changed

4 files changed

+167
-92
lines changed

util/sfc_climo_gen/readme.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Run the sfc_climo_gen program stand-alone on WCOSS2 using
2-
pre-exiting 'grid' and 'orography' files.
2+
pre-exiting 'grid' and 'orography' files. See the
3+
sfc_gen.sh script for details.
34

45
Outputs surface fields such as soil and vegetation type.
6+
7+
Set the configuration variables in sfc_gen.sh. Then
8+
run using the machine specific driver script.

util/sfc_climo_gen/run.hera.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/bin/bash
2+
3+
#------------------------------------------------------------
4+
# Run the sfc_climo_gen program stand-alone on Hera using
5+
# pre-exiting 'grid' and 'orography' files. See the
6+
# sfc_gen.sh script for details.
7+
#
8+
# Set the configuration variables in sfc_gen.sh. Then
9+
# run this script as follows: 'sbatch $script'
10+
#------------------------------------------------------------
11+
12+
#SBATCH -J sfc_climo_gen
13+
#SBATCH -A fv3-cpu
14+
#SBATCH --open-mode=truncate
15+
#SBATCH -o log
16+
#SBATCH -e log
17+
#SBATCH --nodes=1 --ntasks-per-node=24
18+
#SBATCH --partition=bigmem
19+
#SBATCH -q debug
20+
#SBATCH -t 00:10:00
21+
22+
set -x
23+
24+
export APRUN_SFC="srun"
25+
26+
export BASE_DIR=$SLURM_SUBMIT_DIR/../..
27+
28+
$SLURM_SUBMIT_DIR/sfc_gen.sh
29+
30+
exit

util/sfc_climo_gen/run.wcoss2.sh

+5-91
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22

33
#------------------------------------------------------------
44
# Run the sfc_climo_gen program stand-alone on WCOSS2 using
5-
# pre-exiting 'grid' and 'orography files.
5+
# pre-exiting 'grid' and 'orography' files. See the
6+
# sfc_gen.sh script for details.
67
#
7-
# To run, type: 'qsub $script'
8+
# Set the configuration variables in sfc_gen.sh. Then,
9+
# run this script as follows: 'qsub $script'
810
#------------------------------------------------------------
911

1012
#PBS -o log
@@ -22,94 +24,6 @@ export APRUN_SFC="mpiexec -n 24 -ppn 24 -cpu-bind core"
2224

2325
export BASE_DIR=$PBS_O_WORKDIR/../..
2426

25-
source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1
26-
module use ${BASE_DIR}/modulefiles
27-
module load build.$target.intel
28-
module list
29-
30-
#-------------------------------------
31-
# Set model resolution.
32-
#-------------------------------------
33-
34-
export res=384
35-
36-
#-------------------------------------
37-
# Where the model "grid", "mosaic" and "oro" files reside.
38-
#-------------------------------------
39-
40-
export FIX_FV3=${BASE_DIR}/fix/orog/C${res}
41-
42-
#-------------------------------------
43-
# Uncomment for regional grids.
44-
#-------------------------------------
45-
46-
##HALO=3
47-
##export GRIDTYPE=regional
48-
49-
#-------------------------------------------------------------
50-
# Choose which soil type and vegetation type data to use.
51-
#
52-
# For viirs-based vegetation type data, set to:
53-
# 1) "viirs.igbp.0.1" for global 0.10-deg data
54-
# 2) "viirs.igbp.0.05" for global 0.05-deg data
55-
# 3) "viirs.igbp.0.03" for global 0.03-deg data
56-
# 4) "viirs.igbp.conus.30s" for CONUS 30s data
57-
# 4) "viirs.igbp.nh.30s" for NH 30s data
58-
# 4) "viirs.igbp.30s" for global 30s data
59-
#
60-
# For the modis-based vegetation data, set to:
61-
# 1) "modis.igbp.0.05" for global 0.05-deg data
62-
# 2) "modis.igbp.0.03" for global 0.03-deg data
63-
# 3) "modis.igbp.conus.30s" for CONUS 30s data
64-
# 4) "modis.igbp.nh.30s" for NH 30s data
65-
# 5) "modis.igbp.30s" for global 30s data
66-
#
67-
# For STATSGO soil type data
68-
# 1) "statsgo.0.05" for global 0.05-deg data
69-
# 2) "statsgo.0.03" for global 0.03-deg data
70-
# 3) "statsgo.conus.30s" for CONUS 30s data
71-
# 4) "statsgo.nh.30s" for NH 30s data
72-
# 5) "statsgo.30s" for global 30s data
73-
#
74-
# For Beijing Norm. Univ. soil type data
75-
# 1) "bnu.30s" for global 30s data
76-
#-------------------------------------------------------------
77-
78-
export veg_type_src="modis.igbp.0.05"
79-
80-
export soil_type_src="statsgo.0.05"
81-
82-
export vegsoilt_frac='.false.' # When true, outputs percent of each
83-
# soil and veg type category and a
84-
# dominate category. When false, only
85-
# outputs the dominate category. A
86-
# Fortran logical, so include the dots.
87-
88-
#-------------------------------------
89-
# Set working directory and directory where output files will be saved.
90-
#-------------------------------------
91-
92-
export WORK_DIR=/lfs/h2/emc/stmp/$LOGNAME/work.sfc
93-
export SAVE_DIR=/lfs/h2/emc/stmp/$LOGNAME/sfc.C${res}
94-
95-
#-------------------------------------
96-
# Should not have to touch anything below here.
97-
#-------------------------------------
98-
99-
if [[ $GRIDTYPE = "regional" ]]; then
100-
HALO=$(( $HALO + 1 ))
101-
export HALO
102-
ln -fs $FIX_FV3/C${res}_grid.tile7.halo${HALO}.nc $FIX_FV3/C${res}_grid.tile7.nc
103-
ln -fs $FIX_FV3/C${res}_oro_data.tile7.halo${HALO}.nc $FIX_FV3/C${res}_oro_data.tile7.nc
104-
fi
105-
106-
export input_sfc_climo_dir=${BASE_DIR}/fix/sfc_climo
107-
108-
ulimit -a
109-
ulimit -s unlimited
110-
111-
rm -fr $WORK_DIR $SAVE_DIR
112-
113-
${BASE_DIR}/ush/sfc_climo_gen.sh
27+
$PBS_O_WORKDIR/sfc_gen.sh
11428

11529
exit

util/sfc_climo_gen/sfc_gen.sh

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
#!/bin/bash
2+
3+
#-----------------------------------------------------------------------
4+
#
5+
# This script is run by the machine specific driver script.
6+
#
7+
# Set the following variables:
8+
#
9+
# res - Grid resolution. Example: 384 or 384.mx025.
10+
#
11+
# FIX_FV3 - Location of the pre-existing 'grid' and 'orography'
12+
# files. Defaults to ${BASE_DIR}/fix/orog/C${res}, where
13+
# BASE_DIR is the location of the checked out repository.
14+
#
15+
# The required files are:
16+
#
17+
# 'mosaic' file - C${res}_mosaic.nc (Note: 'res' without
18+
# the 'mx' extension.)
19+
#
20+
# 'grid' files - C${res}_grid.tile7.halo${HALO}.nc (regional grids).
21+
# C${res}_grid.tile[1-6].nc (global grids).
22+
# Note: 'res' without the 'mx' extension.
23+
#
24+
# 'orog' files - C${res}_oro_data.tile7.halo${HALO}.nc (regional grids).
25+
# C${res}_oro_data.tile[1-6].nc (global grids).
26+
#
27+
# GRIDTYPE - set to 'regional' for regional grids. Otherwise,
28+
# comment out.
29+
#
30+
# FIX_REG - For regional grids. Hold links to the 'grid' and 'orog' files
31+
# with names expected by the program.
32+
#
33+
# HALO - The number of halo rows/cols. Only for regional grids.
34+
# Otherwise, comment out.
35+
#
36+
# WORK_DIR - Working directory.
37+
#
38+
# SAVE_DIR - Directory where the surface files will be saved.
39+
#
40+
# veg_type_src - Input vegetation type data. Choices are:
41+
# For viirs-based vegetation type data, set to:
42+
# - "viirs.igbp.0.1" for global 0.10-deg data
43+
# - "viirs.igbp.0.05" for global 0.05-deg data
44+
# - "viirs.igbp.0.03" for global 0.03-deg data
45+
# - "viirs.igbp.conus.30s" for CONUS 30s data
46+
# - "viirs.igbp.nh.30s" for NH 30s data
47+
# - "viirs.igbp.30s" for global 30s data
48+
# For the modis-based vegetation data, set to:
49+
# - "modis.igbp.0.05" for global 0.05-deg data
50+
# - "modis.igbp.0.03" for global 0.03-deg data
51+
# - "modis.igbp.conus.30s" for CONUS 30s data
52+
# - "modis.igbp.nh.30s" for NH 30s data
53+
# - "modis.igbp.30s" for global 30s data
54+
#
55+
# soil_type_src - Input soil type data. Choices are:
56+
# For STATSGO soil type data
57+
# - "statsgo.0.05" for global 0.05-deg data
58+
# - "statsgo.0.03" for global 0.03-deg data
59+
# - "statsgo.conus.30s" for CONUS 30s data
60+
# - "statsgo.nh.30s" for NH 30s data
61+
# - "statsgo.30s" for global 30s data
62+
# For Beijing Norm. Univ. soil type data
63+
# - "bnu.30s" for global 30s data
64+
#
65+
# vegsoilt_frac - When .true., output the fraction of each
66+
# vegetation and soil type and the dominant
67+
# category. When .false., output dominant
68+
# category only.
69+
#-----------------------------------------------------------------------
70+
71+
set -x
72+
73+
#export res=96
74+
export res=96.mx100
75+
76+
#HALO=4
77+
#export GRIDTYPE=regional
78+
#FIX_REG=/lfs/h2/emc/stmp/$LOGNAME/fix.reg
79+
80+
export veg_type_src="modis.igbp.0.05"
81+
82+
export soil_type_src="statsgo.0.05"
83+
84+
export WORK_DIR=/lfs/h2/emc/stmp/$LOGNAME/work.sfc
85+
export SAVE_DIR=/lfs/h2/emc/stmp/$LOGNAME/sfc.C${res}
86+
87+
export FIX_FV3=${BASE_DIR}/fix/orog/C${res}
88+
89+
export vegsoilt_frac=.true.
90+
91+
#------------------------------------------------------------------------
92+
#------------------------------------------------------------------------
93+
# Should not have to touch anything below here.
94+
#------------------------------------------------------------------------
95+
#------------------------------------------------------------------------
96+
97+
if [[ "$GRIDTYPE" = "regional" ]]; then
98+
mkdir -p $FIX_REG
99+
ln -fs $FIX_FV3/C${res}_grid.tile7.halo${HALO}.nc $FIX_REG/C${res}_grid.tile7.halo${HALO}.nc
100+
ln -fs $FIX_FV3/C${res}_oro_data.tile7.halo${HALO}.nc $FIX_REG/C${res}_oro_data.tile7.nc
101+
ln -fs $FIX_FV3/C${res}_mosaic.nc $FIX_REG/C${res}_mosaic.nc
102+
export mosaic_file=$FIX_REG/C${res}_mosaic.nc
103+
export FIX_FV3=$FIX_REG
104+
HALO=$(( $HALO + 1 ))
105+
export HALO
106+
else
107+
res2=${res//".mx"*}
108+
export mosaic_file=$FIX_FV3/C${res2}_mosaic.nc
109+
fi
110+
111+
export input_sfc_climo_dir=${BASE_DIR}/fix/sfc_climo
112+
113+
ulimit -a
114+
ulimit -s unlimited
115+
116+
source ${BASE_DIR}/sorc/machine-setup.sh > /dev/null 2>&1
117+
module use ${BASE_DIR}/modulefiles
118+
module load build.$target.intel
119+
module list
120+
121+
rm -fr $WORK_DIR $SAVE_DIR
122+
123+
export APRUN
124+
125+
${BASE_DIR}/ush/sfc_climo_gen.sh
126+
127+
exit

0 commit comments

Comments
 (0)