noaa-ocs-modeling/autoval

Error message if Nowcast=1 in .ini

Opened this issue · 1 comments

If Nowcast is set to 1 (Nowcast=1) in test4_global.ini, there are error messages:
test4_global.ini file:
Nowcast = 1 # Set 1 if you want to include the nowcast period in timeseries.
NowcastPeriod = 6 # Total number of hours for the nowcast period.
NowcastPeriodineachfile = 6 # Number of hours for the nowcast period in each file.
Error messages:
Traceback (most recent call last):
File "/nos/stofs_2d_glo.v1.1.0/autoval/autoval/autoval/validate/run.py", line 258, in
stats, info, datespan, tag = waterLevel (cfg, path, tag)
File "/nos/stofs_2d_glo.v1.1.0/autoval/autoval/autoval/validate/waterlevel.py", line 947, in waterLevel
pointSkill, datespan, tag = pointValidation (cfg, path, tag)
File "/nos/stofs_2d_glo.v1.1.0/autoval/autoval/autoval/validate/waterlevel.py", line 911, in pointValidation
tupleArgs.append((cfg, path, tag, lonMin, lonMax, latMin, latMax, stations, model, tmpDir, datespan, sorted(nowcast_outputFiles),sorted(nowcast_outputFiles_biased)))
UnboundLocalError: local variable 'nowcast_outputFiles' referenced before assignment

If Nowcast is set to 0 (Nowcast=0) in test4_global.ini, there is no error message.

@ps2epsi, thank you for bringing this issue to my attention. I have made the necessary updates to the code on GitHub and tested it using the test4 case for multiple scenarios:

Nowcast = 1
NowcastPeriod = 120
NowcastPeriodineachfile = 6
DynamicBiasCorrection = 1

Nowcast = 1
NowcastPeriod = 6
NowcastPeriodineachfile = 6
DynamicBiasCorrection = 0

Nowcast = 0
NowcastPeriod = 120
NowcastPeriodineachfile = 6
DynamicBiasCorrection = 0

The code worked correctly for all these scenarios. Please download the updated code and rerun test4. If you encounter any further issues, please let me know. Thanks again.