Open anoukvlug opened 5 years ago
It should be quite easy to fix right? Do you plan to submit a fix?
Yes, it should be not to complicated. I could look for a solution and submit it. Though I would prefer to first deal, with PR #814, to limit the versions I have of the code. (It is not right timing for me to start experimenting with having multiple branches at the same time ;) )
I started looking into how to solve this issue. It seems like it might be less straight forward than I thought.
Here is a list of issues that I encountered so far:
netCDF.date2num
. Therefore I think it might be impossible to process these climate files and save them with the standard gcm_data.nc
format that is being used. If saving in this standard format turns out to be impossible, than changes in other parts of the model need to be made in order to be able to solve this issue.@fmaussion, what do you think?
@gyjls
@anoukvlug thanks for looking into this.
The solution depends on the scale of the data you are looking at: the best of course would be to creat compatible files before feeding them to OGGM, i.e. by adding/correcting the files attributes once for all in simple separate notebooks.
A second way is to build all the dirty if .. then
logic in a process_dirty_cesm
function and use this one. In this case I'm relunctant to add this function to OGGM, but I don't see a big issue here since it is possible to use the process_gcm_data
anyway.
Yes, you are right. I thought 'days since ....'
couldn't be negative. As they can be negative there is indeed not as much of a problem as I thought and process_gcm_data
should be able to deal with these files. once they are in the proper format.
I started making a notebook, to preprocess the CESM trace data and use this as climate data to run OGGM. I generated a climate file to test this and tried to use it in the run_from_climate_data
function. This works fine up to going back to ~6700BP.
When going further back in time I get the error:
ValueError: julian day must be a positive integer
In the following part of the code:
with ncDataset(fpath, mode='r') as nc:
time = nc.variables['time']
time = netCDF4.num2date(time[:], time.units)
I am not sure how to best deal with this issue.
A (ugly) work around for this issue is to:
process_gcm_data
write_monthly_climate_file
run_from_climate_data
I tried with @gyjls to use the
process_cesm_data
function to process the 400BP-1990CE files of the CESM trace simulation. Unfortunately the function gives an error, because the files have unlike the CESM-LME notime_bnds
variable.