HARPgroup / HARParchive

This repo houses HARP code development items, resources, and intermediate work products.
1 stars 0 forks source link

HSPF to hsp2 Test Cases #211

Open rburghol opened 2 years ago

rburghol commented 2 years ago

Resources/Goals

HSP2 River test case

HSP2 Land Test Case

hsp2 import_uci A51800.uci A51800.h5
hsp2 run A51800.h5
etc...

Miscellaneous

rburghol commented 2 years ago

Setting up a test case:

  1. Find the files
    
    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

***<----FILE NAME-------------------------------------------------> WDM1 21 ../../../input/scenario/climate/met/nldas1221/met_A51037.wdm WDM2 22 ../../../input/scenario/climate/prad/p20211221/prad_A51037.wdm WDM3 23 ps_sep_div_ams_p532sova_2021_OR1_7700_7980.wdm WDM4 24 OR1_7700_7980.wdm MESSU 25 OR1_7700_7980.ech 26 OR1_7700_7980.out 31 ../../../output/pltgen/river/p532sova_2021/OR1_7700_7980.tau END FILES # get them . hspf_config fgrep ps_sep_div_ams_p532sova_2021_OR1_7700_7980.wdm /files.dir /opt/model/p53/p532c-sova/tmp/wdm/river/p532sova_2021/eos/ps_sep_div_ams_p532sova_2021_OR1_7700_7980.wdm cp /opt/model/p53/p532c-sova/tmp/wdm/river/p532sova_2021/eos/ps_sep_div_ams_p532sova_2021_OR1_7700_7980.wdm ./ cp $CBP_ROOT/input/scenario/climate/met/nldas1221/met_A51037.wdm ./ cp $CBP_ROOT/input/scenario/climate/prad/p20211221/prad_A51037.wdm ./ ``` 2. Get the river WDM. Does this have both the inputs and the outputs from the river, pre-loaded wit inputs from the land runoff? ``` # the river eos fgrep OR1_7700_7980.wdm /files.dir eos="/opt/model/p53/p532c-sova/tmp/wdm/river/p532sova_2021/eos/OR1_7700_7980.wdm" # this river outputs riv="/opt/model/p53/p532c-sova/tmp/wdm/river/p532sova_2021/stream/OR1_7700_7980.wdm" cp $eos ./ ``` 3. Change units line - From: `RESUME 0 RUN UNITS 1` - To: `RESUME 0 RUN 1 UNIT SYSTEM 1` 4.. Import the uci and wdm to h5 format. ``` hsp2 import_uci OR1_7700_7980.uci OR1_7700_7980.h5 DEBUG: Calling readUCI() DEBUG: linkage net Empty DataFrame Columns: [] Index: [] DEBUG: linkage sc None DEBUG: Returned from readUCI Calling readWDM( met_A51037.wdm ) 1003 reading from wdm 1005 reading from wdm 1000 reading from wdm 1001 reading from wdm 1002 reading from wdm 1004 reading from wdm Calling readWDM( prad_A51037.wdm ) 2006 reading from wdm 2004 reading from wdm 2007 reading from wdm 2003 reading from wdm 2005 reading from wdm 2002 reading from wdm 2001 reading from wdm 2000 reading from wdm Calling readWDM( ps_sep_div_ams_p532sova_2021_OR1_7700_7980.wdm ) 3000 reading from wdm 3003 reading from wdm 3006 reading from wdm 3005 reading from wdm 3001 reading from wdm 3004 reading from wdm 3002 reading from wdm 3010 reading from wdm 3008 reading from wdm 3007 reading from wdm 3009 reading from wdm 3061 reading from wdm 3062 reading from wdm 3021 reading from wdm 3022 reading from wdm 3023 reading from wdm 3024 reading from wdm Calling readWDM( OR1_7700_7980.wdm ) 111 reading from wdm 23 reading from wdm 22 reading from wdm 21 reading from wdm 13 reading from wdm 12 reading from wdm 11 reading from wdm 31 reading from wdm 32 reading from wdm 33 reading from wdm 34 reading from wdm 35 reading from wdm 36 reading from wdm 41 reading from wdm 44 reading from wdm 43 reading from wdm 42 reading from wdm 45 reading from wdm 51 reading from wdm 52 reading from wdm 53 reading from wdm 112 reading from wdm 113 reading from wdm 121 reading from wdm 122 reading from wdm 211 reading from wdm 212 reading from wdm 213 reading from wdm 221 reading from wdm 222 reading from wdm 123 reading from wdm 223 reading from wdm 131 reading from wdm 231 reading from wdm 132 reading from wdm 232 reading from wdm 133 reading from wdm 233 reading from wdm 134 reading from wdm 234 reading from wdm 135 reading from wdm 235 reading from wdm 136 reading from wdm 236 reading from wdm 141 reading from wdm 241 reading from wdm 142 reading from wdm 242 reading from wdm 143 reading from wdm 243 reading from wdm 144 reading from wdm 244 reading from wdm 145 reading from wdm 245 reading from wdm 151 reading from wdm 251 reading from wdm 152 reading from wdm 252 reading from wdm 153 reading from wdm 253 reading from wdm 311 reading from wdm 411 reading from wdm 344 reading from wdm 312 reading from wdm 412 reading from wdm 313 reading from wdm 413 reading from wdm 321 reading from wdm 421 reading from wdm 322 reading from wdm 422 reading from wdm 453 reading from wdm 323 reading from wdm 423 reading from wdm 353 reading from wdm 331 reading from wdm 431 reading from wdm 452 reading from wdm 332 reading from wdm 432 reading from wdm 352 reading from wdm 333 reading from wdm 433 reading from wdm 451 reading from wdm 334 reading from wdm 434 reading from wdm 351 reading from wdm 335 reading from wdm 435 reading from wdm 445 reading from wdm 336 reading from wdm 436 reading from wdm 345 reading from wdm 341 reading from wdm 441 reading from wdm 444 reading from wdm 342 reading from wdm 442 reading from wdm 443 reading from wdm 343 reading from wdm ``` 5. Run it ``` hsp2 run OR1_7700_7980.h5 ```
rburghol commented 2 years ago

Try to enable ADCALC.

rburghol commented 2 years ago

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.

rburghol commented 2 years ago

How to debug in python?

rburghol commented 2 years ago

Can run p532 river UCI if we

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