Skip to content

major refactor of stream usage#28

Merged
mvertens merged 101 commits into
NorESMhub:noresmfrom
mvertens:feature/refactor_stream_usage
Jan 28, 2026
Merged

major refactor of stream usage#28
mvertens merged 101 commits into
NorESMhub:noresmfrom
mvertens:feature/refactor_stream_usage

Conversation

@mvertens
Copy link
Copy Markdown
Collaborator

@mvertens mvertens commented Dec 26, 2025

Description of changes

Specific notes

All data mode files across the data components(except for datm_datamode_gefs_mod.F90 and dice_datamode_cplhist_mod.F90) now have explicit setting of streams rather than using the implicit copy used by dfields. Copies that used to be done implicitly using the naming convention assumed by dfields are
now done explictly. This makes it clear what export fields are direct copies and what export fields are
derived fields that have no corresponding stream field.

In each datamode module - there are now two sections in the module variable list: export (and sometimes import) state pointers and stream pointer arrays

The following changes have been made throughout the code: character(*) => character(len=*), trim(subname) => subname (the latter is done since parameters, e.g. subname, don't need trim functions)

The following new routines have been introduced or deleted:

  • dwav
    • dwav_datamode_copyall.F90: new
  • drof
    • drof_datamode_copyall.F90: new
    • introduction of new datatype (stream_pointer_type) for multilevel stream pointers
  • docn
    • combined docn_datamode_copyall_mod.F90 and docn_datamode_iaf_mod.F90 into a new file docn_datamode_sstdata_mod.F90. The two files docn_datamode_copyall_mod.F90 and docn_datamode_iaf_mod.F90 were effectively the same and two different datamodes are not needed since in both cases prescribed SST data was read in. (In addition, docn_datamode_iaf_mod.F90` set pointers to importState data which was never used and not needed).
    • ocn_comp_nuopc.F90: the datamode copyall is now sstdata and the datamode iaf is removed
  • dlnd
    • introduction of new datatype (stream_pointer_type) for multilevel stream pointers
  • dice
    • dice_cplhist_data_mod.F90: still uses dfields since it is used by UFS
  • dglc
    • introduction of new datatype (stream_pointer_type) for multilevel stream pointers

Contributors other than yourself, if any:

CDEPS Issues Fixed: #32

Are there dependencies on other component PRs (if so list):

Are changes expected to change answers (bfb, different to roundoff, more substantial):

Any User Interface Changes (namelist or namelist defaults changes):

Testing performed:

  • aux_cdeps_noresm:
  • prealpha_noresm
    • compared to noresm3_0_beta09 - the only difference is SMS_Lm13.f19_f19_mtn14.I1850Clm50SpG.betzy_intel where atmImp_Faxa_ndep1 and atmImp_Faxa_ndep2 are different due to new new tag cdeps1.0.87_noresm_v2.

Hashes used for testing: noresm3_0_beta09 plus this CDEPS branch

wwieder and others added 30 commits November 10, 2025 11:48
enable NEON v4 data

adds capability to use NEON v4 data for tower site simulations with CTSM

addresses ESCOMP/CTSM#3594

Dependencies: Also requires ESCOMP/CTSM#3597 for NEON cases to work with this new v4 data.

Answer changes: New datm data are answer changing for NEON cases
This compset doesn't seem to be defined anywhere. I'm leaving this test
in place in the aux_cdeps_noresm test list so it can be resolved on that
end - or maybe it's working there somehow.
…d_stream_usage' into feature/refactor_stream_usage
mvertens and others added 26 commits January 16, 2026 16:28
The line break after the last valid value (cplhist) led it to be
interpreted as "cplhist\n", so "cplhist" was determined to be not a
valid value. So apparently we can't have a newline after the last valid
value; I'm not sure about having newlines in other places, but it looked
funny to have newlines in other places and not after the last one, so
I'm just removing all newlines here.

This reverts a change that was made as part of
ESCOMP#373
…sage_escomp

major refactor stream of stream usage

### Description of changes
Major refactor of stream usage

### Specific notes
All data mode files across the data components(except for `datm_datamode_gefs_mod.F90 `and `dice_datamode_cplhist_mod.F90`) now have explicit setting of streams rather than using the implicit copy used by `dfields`. Copies that used to be done implicitly using the naming convention assumed by dfields are
now done explictly. This makes it clear what export fields are direct copies and what export fields are
derived fields that have no corresponding stream field.

In each datamode module - there are now two sections in the module variable list:  `export (and sometimes import) state pointers` and  `stream pointer`.

The following changes have been made throughout the code: `character(*) => character(len=*)`,` trim(subname) => subname` (the latter is done since parameters, e.g. `subname`,  don't need trim functions)

The following new routines have been introduced or deleted:
 - **dwav**
   - dwav_datamode_copyall.F90: new
 - **drof**
   - drof_datamode_copyall.F90: new
   - introduction of new datatype (stream_pointer_type) for multilevel stream pointers
   - expanded list of stream fields needed for drof.cplhist and added new functionality (e.g. `drof_datamode_cplhist_mod.F90`) to support this addition.
 - **docn**
   - combined `docn_datamode_copyall_mod.F90` and `docn_datamode_iaf_mod.F90` into a new file     `docn_datamode_sstdata_mod.F90`. The two files `docn_datamode_copyall_mod.F90` and `docn_datamode_iaf_mod.F90` were effectively the same and two different datamodes are not needed since in both cases prescribed SST data was read in. (In addition, docn_datamode_iaf_mod.F90` set pointers to importState data which was never used and not needed).
   - ocn_comp_nuopc.F90: the datamode copyall is now sstdata and the datamode iaf is removed
   - changed cplhist and multilev_cplhist taxmode from extend to cycle
 - **dlnd**
   - introduction of new datatype (stream_pointer_type) for multilevel stream pointers
 - **dice**
   - dice_cplhist_data_mod.F90: still uses dfields since it is used by UFS
 - **dglc**
   - introduction of new datatype (stream_pointer_type) for multilevel stream pointers

**NOTE**: This PR also provides a new mapfile algorithm as a new option for mapping the streams input to the component model resolution. The new scheme does not have a default but is enabled via adding the following in the appropriate user_nl_XXX_streams where the user needs to fill in the entries in <> below:
<stream_name>:mapalgo = "mapfile:<path to mapping file>
As an example:
`rof.ryf8485_jra:mapalgo="mapfile:/cluster/shared/noresm/inputdata/cpl/cpl6/map_JRA025_to_tnx1v4_e1000r300_170928.nc"`. This new capability enables a significant speedup in stand-alone ocean simulations. See NorESMhub/BLOM#686 (comment).

**NOTE***: 

Contributors other than yourself, if any: None

CDEPS Issues Fixed: ESCOMP#377

Are there dependencies on other component PRs (if so list):

Are changes expected to change answers (bfb, different to roundoff, more substantial):
- docn cplhist mode can change answers due to changing taxmode from extend to cycle

Any User Interface Changes (namelist or namelist defaults changes):

Testing performed (will describe the noresm testing here)
- aux_cdeps_noresm:
  - compared to baseline cdeps1.0.87_noresm_v1 - all passed (ESCOMP#377) and generated new baseline cdeps1.0.87_noresm_v2)
- prealpha_noresm
  - compared to noresm3_0_beta09 - the only difference is SMS_Lm13.f19_f19_mtn14.I1850Clm50SpG.betzy_intel where atmImp_Faxa_ndep1 and atmImp_Faxa_ndep2 are different due to new new tag cdeps1.0.87_noresm_v2.

Hashes used for testing: noresm3_0_beta09 plus this CDEPS branch


Also tested with CESM prealpha tests and a few additional tests (see ESCOMP#376 for details.)
@mvertens
Copy link
Copy Markdown
Collaborator Author

@mvdebolskiy - this PR is now identical to cdeps1.0.88 which was just merged by NCAR. Can we also accept it here? I think it's easier to keep our NorESM version in our fork if you agree.

@mvertens mvertens merged commit 5414f59 into NorESMhub:noresm Jan 28, 2026
@mvertens mvertens deleted the feature/refactor_stream_usage branch January 28, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docn-multilev is not reading in ocn input correctly

5 participants