You still have nans in your forcing then (or a 0 in your absolute permeability might also cause this error). We explicitly check the longwave for nans, but not the other met data. Maybe we need to check all incoming data for NaNs.
There are two ways to see which and where your input data has NaNs:
-
Are you visualizing your data at step 0 (or checkpointing it)? I believe you should get a 0th step vis/checkpoint file if so (I think your error is after the initialization step, so those data should be computed
and written before you get this error). Manually open the hdf5 file with h5py and load the incoming precipitation/temp/etc — are those NaN?
-
Use the Watershed Workflow function ww.getDatasetOnMesh(… method=‘linear') with your met data. You would never do this in the normal workflow because we just write the met data directly as rasters, but if you
do this, you’ll see if the bilinear stencil for computing e.g. temperature on each cell includes a pixel that is NaN.
aorc = ww.sources.ManagerAORC()
met_data = aorc.getDataset(…)
met_data_on_ats_mesh = ww.getDatasetOnMesh(met_data, …, method=‘linear’)
np.where(np.isnan(met_data_on_ats_mesh))
I suspect one of the following is true:
-
You didn’t buffer enough (probably not true)
-
You buffered a reasonable amount, but when you reprojected the data, smoothed the data, or did some other modification to the data, the stencil of that modification used NaNs. (This is particularly a problem
with smoothing and CRS changes.)
-
You’re at a coastal region where your coastline is offshore and AORC has NaN values offshore, so buffering isn’t helping — it’s just adding more ocean pixels with more NaNs.
-
You have internal NaNs (AORC shouldn’t have this, but maybe?) and need to do a call to imputeHoles() to fill those NaNs with real values.
I have yet to see a case where AORC has a NaN in one variable and pixel, but does not have a NaN at that same pixel in other variables. So setting longwave to a constant “fixes" the longwave error, but still does not fix the fact that there are temperature
and precipitation values that are NaN at those same pixels.
Ethan