Skip to content

Conversation

@mvertens
Copy link

@mvertens mvertens commented Oct 30, 2025

Summary: refactor nudging code to use cdeps on line remapping and interpolation

Contributors: @gold2718

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 test was run:
/cluster/work/users/mvertens/noresm/SMS_D.ne16pg3_ne16pg3_mtn14.NF2000.betzy_intel.refactor_nudging/

The following was set in user_nl_cam:

Nudge_model                = .true.
Nudge_Filenames(1)         = '/nird/datalake/NS2345K/ovewh/era5_UVPS_58levels_2020/era5_UVPS_58levels_202012.nc'
Nudge_Meshfile             = '/nird/datalake/NS2345K/ovewh/era5_UVPS_58levels_2020/era5_UVPS_ESMF_Mesh_cdf5.nc'
Nudge_beg_day              = 1
Nudge_beg_month            = 12
Nudge_beg_year             = 2020
Nudge_end_day              = 31
Nudge_end_month            = 12
Nudge_end_year             = 2020
Nudge_file_times_per_day   = 4
Model_update_times_per_day = 48
Nudge_Force_Opt            = 1
Nudge_Uprof                = 1
Nudge_Ucoef                = 1.0
Nudge_Vprof                = 1
Nudge_Vcoef                = 1.0
Nudge_Tprof                = 0
Nudge_Tcoef                = 0.0
Nudge_PSprof               = 0
Nudge_PScoef               = 0.0
interpolate_nlat           = 96
interpolate_nlon           = 144
interpolate_output         = .true.
nhtfrq                     = -1,-1
mfilt                      = 1,1
ndens                      = 2,2
fincl1                     = 'Nudge_U','Nudge_V','Nudge_T','Nudge_Q','Target_U','Target_V','Target_T','Target_Q'

[ List each test suite run. For each suite, include machine, compiler, and any test failures.
For each failure, include the contents of TestStatus or the output from cs.status.testid for that test ]

Issues addressed by this PR: [ For each issue include a GitHub issue entry, one per line. ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

2 participants