Open rburghol opened 1 year ago
ftable_path="$CBP_ROOT/input/param/river/${PARAMS}/ftables/"
Rscript run/resegment/ftable_creation.R JL1_6560_6440_beaver_creek local_channel $ftable_path
cp $ftable_path/JL1_6560_6440_beaver_creek.ftable $ftable_path/${subshed}.ftable
cbp run_rug.csh subsheds $subshed
fgrep JL1_7200_7250_black_creek_rsvr /opt/model/HARParchive/HARP-2022-Summer/AutomatedScripts/SubshedsCreation/subshed_list.csv
# 5758414,JL1_7200_7250_black_creek_rsvr,3.22
# run the resegment script
./run/resegment/add_sub_watershed.bat JL1_7200_7250_black_creek_rsvr JL1_7200_7250 cbp-6.0 subsheds 3.22
subshed="JL1_7202_7200" # from output
ftable_path="$CBP_ROOT/input/param/river/${PARAMS}/ftables/"
Rscript run/resegment/ftable_creation.R JL1_7200_7250_black_creek_rsvr local_channel $ftable_path
cp $ftable_path/JL1_7200_7250_black_creek_rsvr.ftable $ftable_path/${subshed}.ftable
cbp run_rug.csh subsheds JL1_7202_7200
ls tmp/uci/river/subsheds/${subshed}.uci
# now run it all
/opt/model/meta_model/run_model hsp2_cbp6 subsheds $subshed auto river prep
/opt/model/meta_model/run_model hsp2_cbp6 subsheds $subshed auto river run
Errors. Debug:
Error: opening wdm= -2 ../../../tmp/wdm/land/fnp/vadeq_2021/fnp_H51003_JL1_6562_6560.wd
# remove error in last temp dir
rm $CBP_ROOT/tmp/scratch/4062/problem
# prep steps
# 00_init 01_run_rug 03_special_action 04_convert_hsp2 05_ann_load 06_ave_load 08_etm 09_runoff_dsn
/opt/model/meta_model/run_model hsp2_cbp6 subsheds $subshed $CBP_ROOT/tmp/scratch/4062 river prep 03_special_action
/opt/model/meta_model/run_model hsp2_cbp6 subsheds $subshed $CBP_ROOT/tmp/scratch/4062 river prep 04_convert_hsp2
/opt/model/meta_model/run_model hsp2_cbp6 subsheds $subshed $CBP_ROOT/tmp/scratch/4062 river prep 05_ann_load
# error in ann_load step
# Could not find segment JL1_6562_6560 in file ../../../config/catalog/geo/p600/land_water_area.csv
Run New land (which includes the full GEO)
lsegs=`cbp get_landsegs JL1_6562_6560 `
# now use new sbatch technique to run land simultaneously
for i in $lsegs; do
echo "sbatch /opt/model/meta_model/run_model hspf_cbp6 vahydro_2022 $i auto land "
sbatch /opt/model/meta_model/run_model hspf_cbp6 vahydro_2022 $i auto land
done
Beaver Creek
MODEL_ROOT=/opt/model/p6/vadeq
META_MODEL_ROOT=/opt/model/meta_model
IGNORE_PROBLEMS=0 # set this to 1 if you want to plow forward regardless of errors, not advisable but sometimes...
export MODEL_ROOT META_MODEL_ROOT IGNORE_PROBLEMS
lsegs=`cbp get_landsegs JL1_6562_6560 `
# now use new sbatch technique to run land simultaneously
for i in $lsegs; do
echo "sbatch /opt/model/meta_model/run_model hspf_cbp6 vahydro_2022 $i auto land "
sbatch /opt/model/meta_model/run_model hspf_cbp6 vahydro_2022 $i auto land
done
/opt/model/meta_model/run_model hsp2_cbp6 subsheds JL1_6562_6560 auto river
Did not find the model. Debug:
river_segment_name = "JL1_6562_6560"
scenario_name = "subsheds"
input_file_path="/media/model/p6/out/river/subsheds/hydr/"
image_directory_path="/media/model/p6/out/river/subsheds/hydr/images/"
model_version="cbp-6.0"
Need to find model better -- but this is not a good way -- so, we update the propcode for the corresponding segment feature to match the new segment id, then everything works.
but just for posterity, here it is:
model_riverseg <- RomProperty$new(
ds,
list(
propname='riverseg',
entity_type="dh_properties",
propcode=rseg_name
),
TRUE
)
moriverseg <- ds$get_prop(
list(
propname='riverseg',
entity_type="dh_properties",
propcode='PS2_5560_5100'
)
)
candidates = as.array(moriverseg$featureid)
for (i in candidates) {
modelq = list(pid=i, varkey = 'om_water_model_node', propcode = model_version )
model = RomProperty$new(ds,modelq, TRUE)
if (!is.boolean(model)) {
if (!is.na(model$pid)) {
if (model$propcode == model_version ) {
break;
}
}
}
}
cd /opt/model/p6/vadeq/
i=JL1_6562_6560
. hspf_config
scenario=subsheds
/opt/model/meta_model/run_model hsp2_cbp6 $scenario $i auto river
# Ex: run just a single su-step
# /opt/model/meta_model/run_model hsp2_cbp6 $scenario $i tmp/scratch/rwb1_24 river 02_confluence
cd /opt/model/p6/vadeq/
i=JL1_6560_6440
. hspf_config
scenario=subsheds
# use /opt/model/p6/vadeq/tmp/scratch/rwb instead of auto to preserve the data after running
/opt/model/meta_model/run_model hsp2_cbp6 $scenario $i auto river
rmarkdown::render('/usr/local/home/git/vahydro/R/OWS_summaries/ws_model_summary.Rmd',
output_file = '/WorkSpace/modeling/projects/james_river/rivanna/beaver_hsp2/cia_vahydro_subsheds.docx',
params = list( doc_title = ("Test HSP2 Model Summary"),
rseg.file.path = c("http://deq1.bse.vt.edu:81/data/proj3/out/runlog600.351963.log", "http://deq1.bse.vt.edu:81/p6/out/river/subsheds/hydr/JL1_6562_6560_hydrd_wy.csv" ),
rseg.hydrocode = c("vahydrosw_wshed_JL1_6562_6560","vahydrosw_wshed_JL1_6562_6560"),
rseg.ftype = c("vahydro","vahydro"),
rseg.model.version = c("vahydro-1.0","cbp-6.1"),
runid.list = c("runid_600","subsheds"),
rseg.metric.list = c("7q10", "l90_Qout", "l30_year")
)
)
Difficult Run
Rscript.exe ${vahydro_path}/nhd_channel_model_props.R 38.97503 -77.23546
# yields outlet 4509202
Rscript.exe ${vahydro_path}/nhdplus_nested.R 4509202 PM7_4581_4580
cd /opt/model/p6/vadeq/
i=PM7_4620_4580
. hspf_config
scenario=subsheds
# use /opt/model/p6/vadeq/tmp/scratch/rwb instead of auto to preserve the data after running
/opt/model/meta_model/run_model hsp2_cbp6 $scenario $i auto river
Rscript.exe ${vahydro_path}/riverseg_facilities.R PM7_4620_4580 11271.7 4824325 vahydro-1.0 PM7_4620_4580.json
Tasks
Prototype Development
Call this to set up easier access to Rscript.exe when running on windows:
Templates:
Rscript.exe ${vahydro_path}/nhdplus_nested.R 8567219 JL1_6562_6560
Rscript.exe ${vahydro_path}/nhdplus_nested.R 8566805 JL1_6562_6560a
Rscript.exe ${vahydro_path}/nhdplus_nested.R 8566737 JL1_6560_6440
Rscript.exe ${vahydro_path}/nhdplus_nested.R 8566737 JL1_6560_6440 8566805
See the local channel code development here; #16
Copy relevant pieces from old model
Test Run