#474: LFRic-Nudging: Part-A: Introduce ability to read nudging datafiles #474
Conversation
… time-axis definitions
…r the new arguments
|
Is there any chance main could be merged into this branch? I'm currently unable to test the changes with JEDI due to the conflicts |
|
Apologies, I was not aware creating a PR triggers all this activity ! I have changed it to draft till all my testing is complete. |
…at are defined in source code; implement upgrade macro
…2bit as done for other azspice runs; remove unused additions to ancil reading code
Matthew Hambley (MatthewHambley)
left a comment
There was a problem hiding this comment.
One remaining issue, then we can go to trunk.
| use external_forcing_config_mod, only : theta_forcing_nudging, & | ||
| theta_forcing, & | ||
| wind_forcing_nudging, & | ||
| wind_forcing |
There was a problem hiding this comment.
While it's not possible to pass ModelDB to the callback due to a circular dependency, it is possible to pass any configuration you need. Either as primitive values, if there are few of them, or as a namelist type if you need lots of configuration.
This is not an ideal solution as it bloats the callback's argument list but it at least makes the problem explicit. The problem still exists when fetching from global scope, it is just obfuscated. It is more important that we move away from global scope configuration and I think we would rather see our problems than not.
As of yesterday the location of the callback has changed so you will have to merge your branch up to head of trunk before making any changes.
Ideally this would be done by creating a new branch from your development branch and merging that up to head of trunk. This leaves a branch based on a release tag, which the GC group can use, should they care to, and one which can actually merge onto trunk. Unfortunately it doesn't seem to be possible to change the source branch of a pull request.
Instead please add a comment to this pull request with the hash of the head-of-branch before you merge up. This can be used to retrieve the version against the release tag.
|
Latest working commit for dev branch before merging main: 7818d2d |
…ess_nudging_fields*
Matthew Hambley (MatthewHambley)
left a comment
There was a problem hiding this comment.
This change now looks to be ready for trunk.
Thanks Matthew Hambley (@MatthewHambley) . Just adding a reminder here about the test input files to be placed in BIGDATA |
|
#502 has now been committed and I expect this to cause a conflict with this PR. In #502 I split create_model_data into create_model_data and create_physics_model_data. Ideally the changes on this ticket should go into create_physics_model_data and then there should not be any change in the linear_model. |
I will merge with main to resolve conflicts, but I believe the external_forcing with nudging is independant of physics. In fact we have had to move some existing code sections out of #ifdef UM_PHYSICS. |
cjohnson-pi thanks for flagging the conflict! Good question Mohit Dalvi (@mcdalvi) -- I think it could be argued either way. I'd probably lean towards us adding the new fields to the new |
Thanks for the clarification Tom, will merge in the changes accordingly. |
|
Unfortunately, some changes in response to #502 have failed in other developer tests over the weekend. I will try to fix these today. |
cjohnson-pi Thomas Bendall (@tommbendall) : The call to create_nudging_fields requires the field_mapper argument. This is initialised in 'create_model_data' so has to be passed out from there and in to the new 'create_physics_model_data' routine. This is working for gungho and lfric_atm but also means updating the call to 'create_model_data' in other driver routines (jedi_lfric, linear, t1_test, shallow_water, ..) Is there any other way of acccessing field_mapper, or an equivalent ? |
…reate_physics_model_data* routine; needs field_mapper to be made available from the original routine
Ah apologies, I think I hadn't followed that this would be a problem. In that case I think we should call |
Matthew Hambley (MatthewHambley)
left a comment
There was a problem hiding this comment.
Still approved.
c646410
into
MetOffice:main
PR Summary
Sci/Tech Reviewer: Thomas Bendall (@tommbendall)
Code Reviewer: Matthew Hambley (@MatthewHambley)
This PR introduces the ability to read in datafiles that will be used for Nudging the Momentum models (Ref: Nudging NWP to AI/ML models - possibly targeting PS49).
The handling of Nudging data is modelled on existing lateral boundary condition handling in LFRic since they are both required to be interpolated from high time resolution file data on every model timestep.
Nudging changes summary:
Ability to read in nudging data for temperature, U-wind, V-wind and Log surface pressure (required for vertical remapping to model levels).
New [namelist:nudging], which will be active when theta or wind are 'forced by nudging' (in namelist:external_forcing). A corresponding upgrade_macro to add the namelist and I/O related items.
Introduce routine create_nudging_fields to create the nudging input fields as '2-D with user-specified (nudge_data) levels'. Corresponding grid_def_nudging.xml and grid_def_nudging_coarse.xml added to lfric_atm/metadata/.
Introduce ability to read in nudging data on native ('dynamics') or a coarser grid, with rationalising of routines that create the model fields ('make_spec', 'create_model_data') to accept both aerosol and nudging coarse mesh definitions.
Note that the above requires a LFRIC_CORE change to allow defining 3-D coarse grid fields as ''multigrid_ll'' x ndata.
Define a nudging_time_axis which will be populated based on the actual number of time records in the specified nudging file.
Introduce two new rose-stem tests lfric_atm_nwp_gal9_nudging-C48 that reads nudging files on the model grid and lfric_atm_nwp_gal9_nudging_coarse-C48 that reads in data at a lower resolution (C12) grid. This currently uses nudging data created from ERA5 source, but aim is to expand this to AIFS and other models.
At this stage the reference fields are only made available to LFRic and do not modify temperature/ winds.
linked #369: Allow coarse-grid fields with ndata levels: vn3.1 read coarse 2d lfric_core#369
Code Quality Checklist
Testing
Test Branch: test6_vn3p1_nudging_data
trac.log
Test Suite Results - lfric_apps - test6_vn3p1_nudging_data/run1
Suite Information
Task Information
✅ succeeded tasks - 1266
Performance Impact
AI Assistance and Attribution
VsCode - code completion/ snippets.
Documentation
PSyclone Approval
Sci/Tech Review
(Please alert the code reviewer via a tag when you have approved the SR)
Code Review