-
Notifications
You must be signed in to change notification settings - Fork 3
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
Basic calendar functionality #87
Conversation
current_date(t) | ||
Return the model date | ||
""" | ||
current_date(t) = date0 + Dates.Second(t) |
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.
Going forward, it will be best if date0
is not a global variable. The question then is, what is the natural place to store this? There is some code in src regarding a clock that could be expanded or changed to support this!
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.
Yeah, there are a few places in the coming PRs where global variables are used (e.g. landmask
). I can make an issue, so we don't forget to come back to this when we revisit the interface. (#92 )
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.
Looks good @LenkaNovak - what are the scenarios which we will use these data callbacks? Can this be built around the time kept in the integrator?
Thanks for the review @jb-mackay ! 🚀 Yes, I would say that once we re-introduce the interface where the coupler has its own way of keeping track of |
bors r+ |
89: Separate regridding from file reader r=LenkaNovak a=LenkaNovak # PULL REQUEST ## Purpose and Content This PR re-organises the regridding `coupler_utils`, so that regridding is separate from reading the regridded output from `TempestRemap`. - note that mesh generation with the space-filling curve breaks the regridding order required in `TempestRemap`. This was fixed with specifying a `regrid_space` using the previous method of mesh generation. However, this should be generalized in the future. ## Benefits and Risks - benefit: this will enable a monthly callback for temporal interpolation - risk: few more lines to the interface (though this will be removed by the following PR) ## Linked Issues - SDI: #74 - Design: #88 ## Dependent PRs - [x] do not merge before #87 ## PR Checklist - [x] This PR has a corresponding issue OR is linked to an SDI. - [x] I have followed CliMA's codebase [contribution](https://clima.github.io/ClimateMachine.jl/latest/Contributing/) and [style](https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/) guidelines OR N/A. - [x] I have followed CliMA's [documentation policy](https://github.com/CliMA/policies/wiki/Documentation-Policy). - [x] I have checked all issues and PRs and I certify that this PR does not duplicate an open PR. - [x] I linted my code on my local machine prior to submission OR N/A. - [x] Unit tests are included OR N/A. - [x] Code used in an integration test OR N/A. - [x] All tests ran successfully on my local machine OR N/A. - [x] All classes, modules, and function contain docstrings OR N/A. - [x] Documentation has been added/updated OR N/A. Co-authored-by: LenkaNovak <lenka@caltech.edu>
90: Monthly updating of BCs from file r=LenkaNovak a=LenkaNovak # PULL REQUEST ## Purpose and Content This PR adds functionality to collect BC field information in a struct `..._info`, which is then updated each month with a new file read of the regridded data. In the next PR `..._info` will contain two Fields read from a file, which will be used for the daily interpolation. ## Benefits and Risks - benefit: prerequisite for the monthly to daily interpolation - risk: changes the way the BCs are read, but most of it is abstracted ## Linked Issues - SDI: #74 - Design: #88 ## Dependent PRs - no not merge before - [x] #87 - [x] #89 - [x] #93 ## Coupling loop performance - the macro is comparable to using functions (though `@time` larger variability). The pros and cons for this method are [here](#95), are will be revisited post AMIP (and well as including the unit test in the same file). - in either case the monthly update does not cause noticeable performance change from the previous commit for the full AMIP setup. ## PR Checklist - [x] This PR has a corresponding issue OR is linked to an SDI. - [x] I have followed CliMA's codebase [contribution](https://clima.github.io/ClimateMachine.jl/latest/Contributing/) and [style](https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/) guidelines OR N/A. - [x] I have followed CliMA's [documentation policy](https://github.com/CliMA/policies/wiki/Documentation-Policy). - [x] I have checked all issues and PRs and I certify that this PR does not duplicate an open PR. - [x] I linted my code on my local machine prior to submission OR N/A. - [x] Unit tests are included OR N/A. - [x] Code used in an integration test OR N/A. - [x] All tests ran successfully on my local machine OR N/A. - [x] All classes, modules, and function contain docstrings OR N/A. - [x] Documentation has been added/updated OR N/A. Co-authored-by: LenkaNovak <lenka@caltech.edu>
105: Daily interpolation from monthly data (v2) r=LenkaNovak a=LenkaNovak # PULL REQUEST - Update from #91 ## Purpose and Content Adds capability to interpolate linearly between two monthly `Fields`. The demo uses prerequisite PRs outlined in #88 to obtain monthly data. ## Benefits and Risks - benefit: last piece for enabling specifying temporarily varying boundary conditions from a file. - risk: performance slow-down - check are in place (see below) ## Linked Issues - SDI: #74 - Design: #88 ## Dependent PRs - no not merge before #87 , #89 and #90 ## Performance of the final solution - time loop only over added infrastructure of #88 : adding 0.24s per simulation day at `dt = 200s` ## PR Checklist - [x] This PR has a corresponding issue OR is linked to an SDI. - [x] I have followed CliMA's codebase [contribution](https://clima.github.io/ClimateMachine.jl/latest/Contributing/) and [style](https://clima.github.io/ClimateMachine.jl/latest/DevDocs/CodeStyle/) guidelines OR N/A. - [x] I have followed CliMA's [documentation policy](https://github.com/CliMA/policies/wiki/Documentation-Policy). - [x] I have checked all issues and PRs and I certify that this PR does not duplicate an open PR. - [x] I linted my code on my local machine prior to submission OR N/A. - [x] Unit tests are included OR N/A. - [x] Code used in an integration test OR N/A. - [x] All tests ran successfully on my local machine OR N/A. - [x] All classes, modules, and function contain docstrings OR N/A. - [x] Documentation has been added/updated OR N/A. Co-authored-by: LenkaNovak <lenka@caltech.edu>
PULL REQUEST
Purpose and Content
Adds the usage of Dates and a
calendar_callback
macro, which allows evaluations on a particular date. This is a prerequisite PR for BC specification at different times from file.Benefits and Risks
Linked Issues
PR Checklist