Skip to content

Conversation

@slevis-lmwg
Copy link
Contributor

@slevis-lmwg slevis-lmwg commented Sep 10, 2025

Description of changes

Updating

Removing checkboxes from rest of list because need to make this tag before generating new datasets:

  • 5.4 branch tag to make all 5.4 datasets
  • fsurdat/landuse files using make all
  • default_data_1850.cfg which is used by the Makefile
  • fsurdat/landuse files using make all-subset
  • default_data_2000.cfg which is used for making NEON/PLUMBER fsurdat files
  • NEON/PLUMBER fsurdat files
  • namelist_defaults with the new (CTSM5.4) fsurdat/landuse files
  • WhatsNewInCTSM5.4.md in alpha-ctsm5.4.CMIP7.20.ctsm5.3.085: WhatsNewInCTSM5.4.md #3364
  • files in /python/ctsm/test/testinputs if necessary

Specific notes

Contributors other than yourself, if any:
@ekluzek

CTSM Issues Fixed (include github issue #):
Fixes #1775
Fixes #2337
Fixes #2785
Fixes #3304
Fixes #3452
Addresses parts of #2851
Any other ctsm5.4-related or other issues?

Are answers expected to change (and if so in what way)?
Yes, because replacing fsurdat/landuse files.

Any User Interface Changes (namelist or namelist defaults changes)?
Update namelist_defaults with new fsurdat/landuse files.

Does this create a need to change or add documentation? Did you do so?
Update #3364 as needed.

Testing performed, if any:
None so far.

@slevis-lmwg slevis-lmwg self-assigned this Sep 10, 2025
@slevis-lmwg slevis-lmwg moved this from Todo to In Progress in LMWG: Sprint Planning Board Sep 10, 2025
@slevis-lmwg slevis-lmwg moved this from Status not assigned to Prioritized in CTSM: realease-ctsm5.4 minor version update (CMIP7 datasets) Sep 10, 2025
@slevis-lmwg slevis-lmwg linked an issue Sep 10, 2025 that may be closed by this pull request
62 tasks
@slevis-lmwg slevis-lmwg added this to the ctsm5.4.0: CMIP7 Datasets milestone Sep 10, 2025
@slevis-lmwg slevis-lmwg added enhancement new capability or improved behavior of existing capability priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations branch tag: release Changes go on release branch as well as master size: large Large project that will take a few weeks or more non-bfb Changes answers (incl. adding tests) test: aux_clm Pass aux_clm suite before merging test: ctsm_sci Run and check ctsm_sci suite before merging labels Sep 10, 2025
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Sep 10, 2025

Notes about resolving #2337

I'm working in this directory:
/glade/derecho/scratch/slevis/temp_work/ctsm5.4/mk_ctsm54_datasets/tools/mksurfdata_esmf

  1. I uncommented preexisting code but got this compile-time error
There is no matching specific function for this generic function reference.   [PIO_PUT_VAR]
        rcode = pio_put_var(pioid, pio_varid, (/1,ntim/), (/len_trim(string),1/), trim(string))
  1. Test FAILs (see below): I replaced the failing line with rcode = pio_put_var(pioid, pio_varid, trim(string))
  2. If (2) fails, look at line 4772 in src/main/histFileMod.F90 for an alternative: Doesn't work currently because I need to know how to allow adding use ncdio_pio

@ekluzek
Copy link
Collaborator

ekluzek commented Sep 11, 2025

Hmmm, @slevis-lmwg I'm concerned about that doing something different. I think the first line probably needs to use keyword syntax to be clear on what it's doing. That would improve the code readability anyway.

rcode = pio_put_var(ncid=pioid, varid=pio_varid, start=(/1,ntim/), count=(/len_trim(string),1/), ival=trim(string))

Although the above doesn't change the order that it is in PIO, so I don't see why it isn't finding the interface for it?

"string" is just a character of some length and NOT an array right?

The only thing happening with the top version is that it's outputting the string with the time dimension, for time slice ntim. And I'm not certain that the version you are trying will do that. There would need to be some other way to specify the time dimension.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Sep 11, 2025

Hmmm, @slevis-lmwg I'm concerned about that doing something different.

You're correct, my modification in (2) above did this in my 1850-1855 test:

 time = 1850, 1851, 1852, 1853, 1854, 1855 ;

 input_pftdata_filename =
  "/glade/campaign/cesm/cesmdata/inputdata/lnd/clm2/rawdata/CTSM54RawData/globalctsm53histCMIP7Deg025_250417/mksrf_landuse_ctsm53_histCMIP7_1855.c250417.nc\000\020\000\000\f\020\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\030~\211dp\024\000\000\200\311M\215p\024\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\000\300o\206dp\024\000\000\000q\206dp\024",
  "\200|\211dp\024\000\000@\020\b\207p\024\000\000\000\000\000\000\320\017\000\000\b\000@\001",
  "",
  "",
  "",
  "" ;

I think the first line probably needs to use keyword syntax to be clear on what it's doing. That would improve the code readability anyway.

rcode = pio_put_var(ncid=pioid, varid=pio_varid, start=(/1,ntim/), count=(/len_trim(string),1/), ival=trim(string))

This gives the same compile-time error as (1) above.

Although the above doesn't change the order that it is in PIO, so I don't see why it isn't finding the interface for it?

"string" is just a character of some length and NOT an array right?

Correct.

The only thing happening with the top version is that it's outputting the string with the time dimension, for time slice ntim. And I'm not certain that the version you are trying will do that. There would need to be some other way to specify the time dimension.

If I'm interpreting correctly, maybe you mean replacing "string" with an array of all the string values?
Though as written, I think the code remains agnostic of the total number of years, so I'm trying something else for now.

@slevis-lmwg
Copy link
Contributor Author

@ekluzek could this be the problem?
mksurfdata_esmf has its own copy of pio called mkpioMod.F90 and it may not include all the options available in /libraries/parallelio
I will need to familiarize myself with these to answer...

@ekluzek
Copy link
Collaborator

ekluzek commented Sep 12, 2025

@ekluzek could this be the problem? mksurfdata_esmf has its own copy of pio called mkpioMod.F90 and it may not include all the options available in /libraries/parallelio I will need to familiarize myself with these to answer...

@slevis-lmwg the mkpioMod code are just some wrappers around PIO code. But, they all start with mkpio_ so it can't be that. So the problem here seems to be a more fundamental problem, it might be another argument that doesn't match the expected type correctly...

@ekluzek
Copy link
Collaborator

ekluzek commented Sep 12, 2025

Ahhh, I have the interface that it should match here. Above I was using the C version and the variable names are different:

https://ncar.github.io/ParallelIO/group___p_i_o__put__var.html#ga1f74a108488e4d9c411fa411b3a805ad

So try it this way, without specifying the keyword for the first two arguments:

rcode = pio_put_var(pioid, pio_varid, start=(/1,ntim/), count=(/len_trim(string),1/), ival=trim(string))

Or for keyword syntax, use "File=pioid" and "varid=pio_varid". But, also we might need to have pio_varid as an integer instead of as a "var_desc_t" type.

Are you still struggling with this?

Copy link
Contributor Author

@slevis-lmwg slevis-lmwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ekluzek

  • I'm reviewing my own PR to explain my changes so far.
  • make all finished successfully and the submitted jobs are pending in the queue. We will see how many work. We already know that ne3np4.pg2 will not find a mesh file.
  • Speaking of ne3np4.pg2, I had to make the following changes to ccs_config:
diff --git a/component_grids_nuopc.xml b/component_grids_nuopc.xml
index 879d073..5c25fa2 100644
--- a/component_grids_nuopc.xml
+++ b/component_grids_nuopc.xml
@@ -17,6 +17,11 @@
   <!-- ATM/LND meshes regional and global -->
   <!-- ======================================================== -->
 
+  <domain name="400pt_sparse">
+    <nx>13824</nx> <ny>1</ny>
+    <mesh>$DIN_LOC_ROOT/share/meshes/400pt_sparse_13824x1_mesh.nc</mesh>
+    <desc>400-point sparse grid mesh</desc>
+  </domain>
   <domain name="360x720cru">
     <nx>720</nx> <ny>360</ny>
     <mesh>$DIN_LOC_ROOT/share/meshes/360x720_120830_ESMFmesh_c20210507.nc</mesh>
@@ -98,6 +103,11 @@
     <mesh>$DIN_LOC_ROOT/share/meshes/ne3np4_ESMFmesh_c230714_cdf5.nc</mesh>
     <desc>ne3np4 is Spectral Elem 10-deg grid:</desc>
   </domain>
+  <domain name="ne3np4.pg2">
+    <nx>486</nx> <ny>1</ny>
+    <mesh>$DIN_LOC_ROOT/share/meshes/ne3pg2_ESMFmesh_c25xxxx_cdf5.nc</mesh>
+    <desc>ne3np4 is Spectral Elem 10-deg grid:</desc>
+  </domain>
   <domain name="ne3np4.pg3">
     <nx>486</nx> <ny>1</ny>
     <mesh>$DIN_LOC_ROOT/share/meshes/ne3pg3_ESMFmesh_c221214_cdf5.nc</mesh>
diff --git a/modelgrid_aliases_nuopc.xml b/modelgrid_aliases_nuopc.xml
index 6b380b6..eb211a2 100644
--- a/modelgrid_aliases_nuopc.xml
+++ b/modelgrid_aliases_nuopc.xml
@@ -154,6 +154,13 @@
     <mask>0.125nldas2</mask>
   </model_grid>
 
+  <model_grid alias="400pt_sparse" not_compset="_MOM" compset="DATM.+CLM">
+    <grid name="atm">400pt_sparse</grid>
+    <grid name="lnd">400pt_sparse</grid>
+    <grid name="ocnice">400pt_sparse</grid>
+    <mask>400pt_sparse</mask>
+  </model_grid>
+
   <model_grid alias="hcru_hcru_mt13" not_compset="_MOM" compset="DATM.+CLM">
     <grid name="atm">360x720cru</grid>
     <grid name="lnd">360x720cru</grid>

400pt_sparse simulations just point to the f19_400pt_sparse mesh file
and do not need their own unique fsurdat file
@slevis-lmwg slevis-lmwg changed the title Make CTSM5.4 fsurdat/landuse datasets Prepare Makefile to make CTSM5.4 fsurdat/landuse datasets Oct 10, 2025
Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slevis-lmwg and I went over this and this is all great. One suggestion is to add a comment somewhere about the need to break up the ne3 historical into three separate jobs, because the low number of processors makes it take a long time.

And also we realized that the 1x1_brazil grids needed some changes. This wasn't quite right in the Grids document, so we corrected it there.

The bottom line with this is that want the datasets created to match the document.

@slevis-lmwg slevis-lmwg removed the blocked: answer changing Can't be resolved until we're ready for answer changes on master label Oct 10, 2025
@slevis-lmwg slevis-lmwg moved this from Stalled to In Progress in LMWG: Sprint Planning Board Oct 10, 2025
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Oct 14, 2025

Ooops I got ahead of myself and put Peter's new lai and soilcolor files in this PR.
@ekluzek do you really feel I should bring them in with a separate PR?

@ekluzek
Copy link
Collaborator

ekluzek commented Oct 14, 2025

I recommend separating the part that changes results for the surface datasets into a different PR. Otherwise it gets lost in the part that doesn't change answers, which is most of what this PR is about.

@ekluzek
Copy link
Collaborator

ekluzek commented Oct 14, 2025

I suggest bringing this into the alpha branch and make a tag for it. You could rerun the testing, but as it doesn't touch model code, I'd just make sure the makefile works, and create a softlink to the previous baselines.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Oct 14, 2025

@ekluzek I updated this PR to the latest tag in the alpha branch but ALSO to the latest tag in master (LMK if this does not make sense to you).

I started testing to confirm that I didn't mess anything up. This PR's tag will still be "12" since it only changes answers due to the changes in master. Again LMK if you disagree:

OK ./build-namelist_test.pl
PASS make black, make lint
PASS ./run_ctsm_py_tests
OK ./run_sys_tests -s aux_clm -c alpha-ctsm5.4.CMIP7.12.ctsm5.3.075 -g alpha-ctsm5.4.CMIP7.12.ctsm5.3.079

@slevis-lmwg
Copy link
Contributor Author

@ekluzek
I see the flaw in my logic to git merge ctsm5.3.079 to this branch:

  • Now this PR is ahead of the alpha branch...
  • Would you have me resolve this by opening another PR where I merge 079 to the alpha branch? Or would you not worry about it at this point?

@ekluzek
Copy link
Collaborator

ekluzek commented Oct 14, 2025

@ekluzek I updated this PR to the latest tag in the alpha branch but ALSO to the latest tag in master (LMK if this does not make sense to you).

Yeah, this is something good to be on the same page about. Although since it's a branch it's not as important as on main branches. But, the ctsm5.4 branch is an important one, so probably good to sync up on.

I prefer having the "11" updated whenever there are changes along the branch even if they don't change answers. And I prefer doing a separate PR for a merge update, and not mixing it with other changes. Basically that means a few more tags, so the steps are more clearly defined and separable.

For a PR that is solely just a merge to a later ctsm tag, I'd leave the "11" alone, because it represents a change in the ctsm base version, and NOT on the branch. It's helpful to think of the "11" as the number of tags along the branch that don't change the base version, and the final ctsm tag part to be the ctsm tag it's based off of. So "11" shows there were 11 tagged sets of changes that diverge from master, and the difference in ctsm version from the last tag (ctsm5.3.075) from the first ctsm5.4 tag (ctsm5.3.40) shows the span of ctsm versions that the ctsm5.4 has gone through.

We do want to be on the same page about the naming convention for alpha tags. But, I don't want to dictate too much about how people handle their PR's. So we can do things slightly differently there, IMHO.

@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Oct 14, 2025

Thanks @ekluzek. Based on your post (which makes sense to me), I will add a few steps:

Notes:

  • NOT DONE in this PR (no response, yet): If Adam confirms, change 1979-2030 to 1979-2023 to agree with the spreadsheet.
  • I also started branch new_raw_lai_and_soilcolor based on this PR's branch, to which I have reintroduced the corrected raw lai and corresponding soil color file. With that I submitted make all to generate replacement fsurdat/landuse files needed by Will, Cecile, and possibly others. BUT UPDATE: Peter L. provided new pft timeseries from 1700 as well, so rerunning make all. Peter L. also provided the NOANTHRO raw data, so update cmip_era accordingly and any relevant documentation in the code. See alpha-ctsm5.4.CMIP7.14.ctsm5.3.079: New raw lai, soilcolor, 1700-2023 landuse files, and NOANTHRO landuse file #3555.
  • Now ready to merge this PR.

The test seemed fixed in a short range of tags:
ctsm5.3.063 to .072
and
alpha-ctsm5.4.CMIP7.09.ctsm5.3.068 to .075
@slevis-lmwg slevis-lmwg changed the title Prepare Makefile to make CTSM5.4 fsurdat/landuse datasets alpha-ctsm5.4.CMIP7.13.ctsm5.3.079: Prepare Makefile to make CTSM5.4 fsurdat/landuse datasets Oct 17, 2025
@slevis-lmwg slevis-lmwg merged commit b9b9c73 into ESCOMP:alpha-ctsm5.4.CMIP7 Oct 17, 2025
6 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in LMWG: Sprint Planning Board Oct 17, 2025
@slevis-lmwg slevis-lmwg deleted the make_ctsm54_datasets branch October 17, 2025 20:56
@slevis-lmwg
Copy link
Contributor Author

This PR spanned more than one Sprint, and the time estimate in weeks represents my time spent in the current Sprint only.

@github-project-automation github-project-automation bot moved this to Ready to start (or start again) in CTSM: Upcoming tags Oct 17, 2025
@slevis-lmwg slevis-lmwg moved this from Ready to start (or start again) to release/externals tags done in CTSM: Upcoming tags Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

branch tag: release Changes go on release branch as well as master enhancement new capability or improved behavior of existing capability non-bfb Changes answers (incl. adding tests) priority: high High priority to fix/merge soon, e.g., because it is a problem in important configurations size: large Large project that will take a few weeks or more test: aux_clm Pass aux_clm suite before merging test: ctsm_sci Run and check ctsm_sci suite before merging

Projects

Status: release/externals tags done
Status: Done

2 participants