nasa / RHEAS

Regional Hydrologic Extremes Assessment System
MIT License
73 stars 54 forks source link

Trouble writing forcings for forecasts #52

Closed AdamJDuncan closed 5 years ago

AdamJDuncan commented 8 years ago

Trouble with most recent update to Master.

ESP forecast runs if the data exists for range between 'startdate' and 'enddate' (ie if it's a hindcast). Extend the enddate past the exiting datarange (ie forecast), and you get the new "Forcing" error. It always raised this issue in the past but just gave a warning. I tried commenting out the assertion as well but it leads to an error now. So forecast appears to require input from the forecast daterange.

Examples:

I have data to Sept 2 for both CMORPH & NCEP.

Works:

[forecast]
model: vic
startdate: 2016-8-1
enddate: 2016-8-31
basin: /home/ubuntu14/RHEAS/bin/bbox/Kayah16.shp
name: ForecastTestKayahA
resolution: 0.25
ensemble size: 20
method: esp

[vic]
precip: cmorph
temperature: ncep
wind: ncep
initialize: off
save to: db
save: soil_moist, prec

Gets ""Missing meteorological data in database for VIC simulation. Exiting...":

[forecast]
model: vic
startdate: 2016-8-1
enddate: 2016-10-31
basin: /home/ubuntu14/RHEAS/bin/bbox/Kayah16.shp
name: ForecastTestKayahA
resolution: 0.25
ensemble size: 20
method: esp

[vic]
precip: cmorph
temperature: ncep
wind: ncep
initialize: off
save to: db
save: soil_moist, prec

Only difference is enddate.

AdamJDuncan commented 8 years ago

Without assertion:

Traceback (most recent call last):
  File "./rheas", line 16, in <module>
    sys.exit(rheas.run())
  File "/home/ubuntu14/RHEAS/src/rheas.py", line 91, in run
    forecast.execute(dbname, options)
  File "/home/ubuntu14/RHEAS/src/forecast.py", line 98, in execute
    runVIC(dbname, options)
  File "/home/ubuntu14/RHEAS/src/forecast.py", line 57, in runVIC
    models.writeForcings(method, options)
  File "/home/ubuntu14/RHEAS/src/ensemble.py", line 140, in writeForcings
    self._ESP(options)
  File "/home/ubuntu14/RHEAS/src/ensemble.py", line 209, in _ESP
    model.writeForcings(prec, tmax, tmin, wind)
  File "/home/ubuntu14/RHEAS/src/vic/vic.py", line 404, in writeForcings
    prec[i][2], tmax[i][2], tmin[i][2], wind[i][2]))
IndexError: list index out of range
AdamJDuncan commented 8 years ago

This is not an issue with CHIRPS.

nndas commented 5 years ago

Resolved.