Open rburghol opened 2 years ago
Setting up a test case:
head -n 20 OR1_7700_7980.uci
RUN
GLOBAL OR1_7700_7 riv | P5 | p532sova_2 | Club START 1984/01/01 END 2019/12/31 RUN INTERP OUTPUT LEVEL 1 1 RESUME 0 RUN 1 TSSFL 15 WDMSFL 16 END GLOBAL
FILES
git diff honly..master HSP2/main.py
Try to enable ADCALC.
cbp run_rug.csh p532sova_2021 OR1_7700_7980
cbp run_river.csh p532sova_2021 OR1_7700_7980
cp /opt/model/p53/p532c-sova/tmp/uci/river/p532sova_2021/OR1_7700_7980.uci /home/rob/working/modeling/hsp2/test_cbp_river
hsp2 import_uci OR1_7700_7980.uci OR1_7700_7980.h5
workshsp2 run OR1_7700_7980.h5
File "/opt/model/HSPsquared/HSP2/main.py", line 170, in main
ui['FLAGS']['HTFG'] = flags['HTRCH']
KeyError: 'FLAGS'
HTRCH
patch_uci_head.sh
patch_uci_head.sh new_uci uci_with_correct_header
./patch_uci_head.sh /opt/model/p53/p532c-sova/tmp/uci/river/p532sova_2021/OR1_7700_7980.uci OR1_7700_7980.uci
OXRX
Problem was setting FLAGS as default for ALL modules because some modules would fail on blank FLAGS. Need to test default ui[FLAGS] on each module to see where it can help/hinder.
How to debug in python?
print(*a, sep = "\n")
print(*ui['FLAGS'], sep = "\n")
Can run p532 river UCI if we
./patch_uci_head.sh /opt/model/p53/p532c-sova/tmp/uci/river/p532sova_2021/OR1_7700_7980.uci OR1_7700_7980.uci
hsp2 import_uci OR1_7700_7980.uci OR1_7700_7980.h5
hsp2 run OR1_7700_7980.h5
h5dump -n OR1_7700_7980.h5 | grep 111
/TIMESERIES/TS111/table
h5dump -d "/RESULTS/RCHRES_R001/HYDR/table" OR1_7700_7980.h5
Rscript 1: Try to access data from h5 file post-run.
R
library("rhdf5")
rchres_data = h5read("OR1_7700_7980.h5", "/RESULTS/RCHRES_R001/HYDR/table")
quantile(rchres_data$ROVOL)
0% 25% 50% 75% 100%
0.1229398 2.8218678 5.1851766 9.1894212 414.5833130
Code 1: Excerpt from config/control/river/p532sova_2021.con
*** active modules for this scenario
MODULES
HYDR
ADCALC
***CONS
***HTRCH
***SEDTRN
***GQUAL
***RQUAL
***OXRX
***NUTRX
***PLANK
***PHCARB
END MODULES
Resources/Goals
h5dump
- command line access to hdf5 databasesh5dump --help
lists command line option ("-- or - switches)?h5read
show help file in RHSP2 River test case
mkdir cbp_river_test
cd cbp_river_test
wget https://github.com/HARPgroup/HSPsquared/raw/master/tests/test_cbp_river/OR1_7700_7980.uci
hsp2 import_uci OR1_7700_7980.uci OR1_7700_7980.h5
hsp2 run OR1_7700_7980.h5
HSP2 Land Test Case
Miscellaneous
cp $CBP_ROOT/tmp/wdm/river/p532sova_2021/eos/OR1_7700_7980.wdm ./