bugfix for handling unstructured input data with multiple levels#26
Merged
mvertens merged 18 commits intoDec 31, 2025
Merged
Conversation
…am_pointer_2d to have optional arguments requirePointer and errmsg and set default values to nan
…ort field pointers
gold2718
requested changes
Dec 28, 2025
Collaborator
gold2718
left a comment
There was a problem hiding this comment.
I found a few items that need fixing. Is there a way to test all the log output to make sure it is happening correctly?
Collaborator
Author
|
@gold2718 - thanks for your careful review - I think this is ready for another review. |
gold2718
requested changes
Dec 31, 2025
Collaborator
gold2718
left a comment
There was a problem hiding this comment.
I still have some requests. Most of these are suggested improvements, however, there are a couple of statements which could cause problems or crash the run.
Collaborator
Author
|
@gold2718 - I've addressed all of your comments. Thanks for catching the problems. |
gold2718
added a commit
to NorESMhub/CAM
that referenced
this pull request
Apr 23, 2026
noresm3_0_031_cam6_4_121: refactor nudging code to use CDEPS Summary: Refactor nudging code to use CDEPS on line remapping and interpolation Contributors: @mvertens, @gold2718, @Ovewh Reviewers: @gold2718 Purpose of changes: The current nudging code (nudging.F90) requires a single file for every time sample - and often this is every 6 hours. In addition it does not do any mapping from the forcing data to the model grid. Using the CDEPS inline functionality along with its capability to do online horizontal regridding (including for multiple vertical levels) and time interpolation the nudging code has been completely refactored. With this new code - monthly nudging data can be read at just one resolution and the model vertical levels and used with any model grid. The one change that comes with this is if there is missing data. In the original scheme, if missing data was encountered then the model 'coasted' through the forcing interval and was not nudged. In the new scheme, the time interpolation (linear or upper) is used with the actual data that is available. To see more details of the inline functionality from CDEPS used here see: https://escomp.github.io/CDEPS/versions/master/html/index.html and in particular https://escomp.github.io/CDEPS/versions/master/html/streams.html#data-model-stream-inline-api Changes made to build system: None Changes made to the namelist: The following new namelist variables were introduced: Nudge_Filenames, Nudge_Meshfile, Nugde_beg_day, Nudge_beg_month, Nudge_beg_year, Nudge_end_day, Nudge_end_month, Nudge_end_year, Nudge_file_times_per_day, Model_update_times_per_day Changes to the defaults for the boundary datasets: None Substantial timing or memory changes: TODO - the expectation is that the new code should be faster than the old one since a new file does not have to be opened and closed at every nudging time step. This needs to be confirmed. Validation: The following validation was run. using a noresm3_0_beta09 sandbox with this PR and the CDEPS PR NorESMhub/CDEPS#26. Two simulations were done - a reference simulation and a nudging to the reference simulation. Testing: - Two tests were added to aux_cam_noresm which test this functionality - Tested on Betzy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
This fixes #25
Specific notes
This PR also does the following:
character(*) with character(len=*)logunitandmainprocin shr_strdata_type and bothlogunitandmainprocin shr_stream_streamType. This is needed since the inline interface was not always writing all log output consistently.dshr_strdata_mod.F90forshr_strdata_get_stream_pointer_1d and shr_strdata_get_stream_pointer_2d
and
If requirePointer is not provided - then if the pointer is not round the subroutine returns without an error. If requirePointer is an argument and is true, than normally an errmsg is provided that with it describes why the pointer is required. Also - now if the pointer is required and is found - then the pointer is initialized to NaN.
The new setting of NaNs in the stream and state pointers resulted in the following additional changes that needed to be brought in:
Contributors other than yourself, if any: None
CDEPS Issues Fixed: #25
Are there dependencies on other component PRs: None
Are changes expected to change answers (bfb, different to roundoff, more substantial): bfb
Any User Interface Changes (namelist or namelist defaults changes): None
Testing performed:
Hashes used for testing:
noresm3_0_beta09 with this PR