-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
run for gcm #273
run for gcm #273
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good! I have a few suggestions, otherwise this is good to go!
@@ -1653,3 +1653,63 @@ def iterative_initial_glacier_search(gdir, y0=None, init_bias=0., rtol=0.005, | |||
_ = past_model.run_until_and_store(y1, path=path) | |||
else: | |||
past_model.to_netcdf(path) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line here (PEP8)
Parameters | ||
---------- | ||
y0 : is the start year of the model run | ||
y1 : is the end year of the model run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aren't these parameters missing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid confusion with the y0
of the random run, I suggest to call them ys
and ye
(for start and end) instead.
kwargs.setdefault('glen_a', glen_a) | ||
|
||
y0 = cfg.PARAMS['y0'] | ||
ye = cfg.PARAMS['y1'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aha I see. Can you also change the name of the params to ys
, ye
in the params.cfg
file?
You can keep the idea of having them as keyword arguments in the function and use the params as default if the user didn't set them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if I understand what you are suggesting. Do you mean that I add
ys = y0
ye = y1
to the cfg.params?
ye = cfg.PARAMS['y1'] | ||
|
||
mb_model = oggm.core.models.massbalance.\ | ||
PastMassBalanceModel(gdir, filename=filename, filesuffix=filesuffix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use mbmods.PastMassBalanceModel
instead
raise RuntimeError( | ||
'%s: we did our best, the model is still ' | ||
'unstable.', gdir.rgi_id) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic slitghly changed in the most OGGM version. See https://github.com/OGGM/oggm/blob/master/oggm/core/models/flowline.py#L1602-L1605 and copy from there
Thank you for the feedback! I have also looked into the problem with the process_cesm_data function, but I didn't found a way to fix it yet. So that will probably need to wait a bit, as I will be out of office the next 2 weeks. |
I have to leave on holidays now, so I'd suggest that either we merge this now or it waits until sept. |
If you have to leave right this moment I wish you a very nice holiday! The PR can wait till September. |
@anoukvlug do you have time to work on this in the next days? Otherwise I might merge this soon and make the changes myself later. |
No, I won't have time to work on this till the end of the ArcTrain Annual Meeting. So the earliest day I could start working on it will be the 25th of September. |
OK, no problem! I can start from here |
Merging this now, will add my modifs and tests in a subsequent PR. Thanks! |
This is a pull request for the function run_from_gcm. The function is for a large part a copy of random_glacier_evolution function. The function can be used to run the glaciers with a the climate from for instance a CESM simulation.
I could later include a 'spin-up' option in the function, but I would first like to discuss the basis.