Open rburghol opened 2 years ago
#/bin/bash
# load environment if not already loaded
if (! $?SCRIPT_DIR) then
. hspf_config
source $CBP_ROOT/config/control/script/${scenario}.con
endif
scenario=$1
segment=$2
# set up places to look for plugins
model_plugins=$CBP_ROOT/plugins/$model
module="river"
for steps in "prep run postproc analyze"; do
if [ -d $model_plugins/$module/$steps ]; then
for plugin in `ls $model_plugins/$module/$steps/`; do
$model_plugins/$module/$steps/$plugin $scenario $segment
done
fi
done
Use examples:
Arguments:
This now works:
/opt/model/meta_model/run_model hsp2_cbp6 vadeq_2021 JL3_7090_7150 test river
script to insert positional script.
model_bump step
#!/bin/bash
inpos=$1
nextpos=$((inpos + 1))
# if there are no files in the next slot, we just move this slots files up one
# otherwise, we shuffle everything up 1 slot
i=98
while [ $i -ge $inpos ] ; do
j=`printf "%02g" $i`
echo "$j";
movers=`ls ${j}_* 2>/dev/null`
for onefile in $movers; do
num=${onefile:0:2}
newnum=$((10#$num + 1))
newindex=`printf "%02g" $newnum`
newfile=${onefile/$num/$newindex}
echo "Moving: $onefile $newfile"
mv $onefile $newfile
done
i=$((i - 1))
done
Examples:
run
phase, hsp2
: /opt/model/meta_model/run_model hsp2_cbp6 hsp2_2022 JL1_7080_7190 h2_test river run
08_run_river
in run
phase, hsp2
: /opt/model/meta_model/run_model hsp2_cbp6 hsp2_2022 JL1_7080_7190 h2_test river run 08_run_river
run
phase hspf
: /opt/model/meta_model/run_model hspf_cbp6 hsp2_2022 JL1_7080_7190 h2_test river run
Run only the organic scour routine (not needed for hydro only, but if there are errors, this can be examined):
/opt/model/meta_model/run_model hsp2_cbp6 hsp2_2022 JL1_7080_7190 h2_test river run 11_scour_org
/opt/model/meta_model/run_model hsp2_cbp6 hsp2_2022 JL1_7080_7190 /opt/model/p6/vadeq/tmp/rob-scratch/h2_test river run 11_scour_org
ERROR: the wdm file
../../../tmp/wdm/river/hsp2_2022/stream/JL1_7080_7190.wdm
Had zero flow for the first month
Tasks
models/[model name]/river/prep/
models/[model name]/river/run/
. plugins/[model]/model_config
to load env varsPlug-in function design
run_model
run_model model scenario segment run_directory [modules all/land, river] [submodule all/prep,run] [step all/01,02, or full name "01_run_rug" or function name "run_rug"]
run_model cbp_hsp2 vadeq_2021 JL3_xxxx_yyyy all
run_model cbp_hsp2 vadeq_2021 N51003 land all
-use-slurm
: 1/0-slurm-jobname
-slurm-dependency
-slurm-output
models/[model name]/[module]/
models/[model name]/[module]/prep/
models/[model name]/[module]/run/
models/[model name]/[module]/post/
models/[model name]/[module]/analyze/
models/hsp2/river/prep/01_run_rug
(A soft link to run/standard/run_lug.csh)models/hsp2/river/prep/02_convert_uci
(A short script to call the HSPF to hsp2 conversion routine)models/hsp2/river/postproc/01_export_to_wdm
used in stream_wdm.exeObject class summary scripts
other function naming conventions considered
./models/[model name]/export_land
./models/[model name]/summary_river
./models/[model name]/etm
./models/hsp2/summary_river