Skip to content

Distributed parameters#3405

Draft
swensosc wants to merge 76 commits intoESCOMP:b4b-devfrom
swensosc:distributed_parameters
Draft

Distributed parameters#3405
swensosc wants to merge 76 commits intoESCOMP:b4b-devfrom
swensosc:distributed_parameters

Conversation

@swensosc
Copy link
Contributor

@swensosc swensosc commented Aug 11, 2025

Description of changes

Make some parameters spatially distributed, with data ingested via streams file.

Specific notes

Contributors other than yourself, if any:

CTSM Issues Fixed (include github issue #):
See this discussion:
#2395

Are answers expected to change (and if so in what way)? No

Any User Interface Changes (namelist or namelist defaults changes)? Yes
New namelist parameters:
- use_distributed_parameters
- stream_fldfilename_distparam
- stream_meshfile_distparam

Does this create a need to change or add documentation? Did you do so? Yes No

Testing performed, if any: @ekluzek will do regular

@ekluzek ekluzek self-assigned this Oct 7, 2025
@ekluzek
Copy link
Collaborator

ekluzek commented Oct 7, 2025

We should be able to show this as b4b-dev, so will likely rebase to b4b-dev, once we can show that.

@ekluzek ekluzek marked this pull request as draft October 7, 2025 16:46
@ekluzek ekluzek added enhancement new capability or improved behavior of existing capability bfb bit-for-bit science Enhancement to or bug impacting science labels Oct 7, 2025
@slevis-lmwg
Copy link
Contributor

@swensosc raised the question whether this will be in clm6. I will add a milestone to the PR.

@slevis-lmwg slevis-lmwg added this to the ctsm6.0.0 (code freeze) milestone Dec 11, 2025
@ekluzek
Copy link
Collaborator

ekluzek commented Mar 3, 2026

This has been blocked by #3391

This was also a desired feature highlighted in the LMWG meeting, so we need to start working on this so it can be used by more people.

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 3, 2026

I'll update this to the latest, so that we can create a branch tag with this for some coupled model testing that is desired.

@wwieder
Copy link
Contributor

wwieder commented Mar 4, 2026

@swensosc the following were previously shown to have strong influence on arctic snow melt (based on attributes in our latest parameter file).

xdrdt=5, 
scvng_fct_mlt_sf=0.5, 
snw_rds_refrz=1500, 
fresh_snw_rds_max=400

From these, the most influential is likely xdrdt.

@olyson summarized the following based on our dead veg work a few years ago:

Regarding increasing albedo, our best bets are probably xdrdt and upplim_destruct_metamorph. Increasing xdrdt from 1 to 5 decreased albedo by maybe 2-4% over Antarctica so reversing that would hopefully result in an increase by that amount. Decreasing upplim_destruct_metamorph from 250 to 100 decreased albedo by 1-2%, so maybe we could go to 400 to increase albedo (we are at 250 now). fresh_snw_rds_max is also a possibility, it is now 400 and an increase from about 204 to 400 decreased albedo by 1-2% also, so we could try going back down to 200 or so. Not clear that the combined effects of these would be a simple sum, there must be some kind of upper limit on fresh snow albedo. Maybe first try a couple of these in land-only mode to make sure we get the magnitude and direction we are expecting in Antarctica.

@ekluzek ekluzek changed the base branch from master to b4b-dev March 5, 2026 20:20
 Conflicts:
	bld/CLMBuildNamelist.pm
	bld/namelist_files/namelist_defaults_ctsm.xml
	src/biogeophys/SoilHydrologyMod.F90
	src/main/atm2lndType.F90
@ekluzek
Copy link
Collaborator

ekluzek commented Mar 6, 2026

@swensosc do you have a distributed parameter file/mesh that I can test with?

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 6, 2026

OK, I updated to the latest on b4b-dev, which is up to ctsm5.4.021. A good number of tests passed, but a lot failed, many with a build error. Hopefully, the build error is simple. Here's the summary....

Test summary
297 Total tests
198 Tests passed
1 Tests compare different to baseline
0 Tests are new where there is no baseline
0 Tests pending
99 Tests failed

I'll push the update, and then see if the build error is easy. I also think we should test on Izumi with nag, as that can often find legit problems.

nparams = 0
do n=1,nvariables
call ncd_inqvname(ncid,n,varname,var_desc)
if (.not. any(varname == (/'time','lat','lon'/))) then
Copy link
Collaborator

Choose a reason for hiding this comment

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

This actually results in a build problem with at least the gnu compiler. The '(/ /)' syntax for strings requires that the strings be of the same length. So a space could be added to the end of lat and lon for example. But, then the string match isn't going to work. A "trim" can certainly be added to "varname" and probably to the array? So maybe this will work...

Suggested change
if (.not. any(varname == (/'time','lat','lon'/))) then
if (.not. any(trim(varname) == trim( (/'time','lat','lon'/) ) ) ) then

Copy link
Collaborator

Choose a reason for hiding this comment

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

Nope, trim only takes scalar arguments. I'm trying to think of a way to use index to check for substrings, but not seeing a way to get that to work. So it probably needs an additional loop to go through the dimension names so trim can be used on both sides. Which means some overhead to save the array and such. A little annoying, but not hard to do...

@swensosc
Copy link
Contributor Author

swensosc commented Mar 6, 2026 via email

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 6, 2026

I didn't know about the string length constraint. Would it work to do this? any((/trim(varname) == 'time',trim(varname) == 'lat',trim(varname) == 'lon'/)) )

It does! So I'll go with that for now. the above isn't as clean as the original, but better than the loop suggestion. So longer term, we'll probably do something else -- but this is a decent starting point.

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 6, 2026

Things that I see needed to get a branch tag done today:

  • Get gnu working
  • Add the script to make distparams to tools/contrib
  • Make a test distparams file and testmod to use it
  • Update to ctsm5.4.022 (rebase this to master)
  • Make a branch tag: branch_tags/distparams.n02.ctsm5.4.022
  • Make sure most tests work (the same tests should fail from b4b-dev: Move nml parameters (changes paramfile) #3391)
  • Run and add a distparam test
  • Test on Izumi and show most tests work
  • Make a branch tag: branch_tags/distparams.n02.ctsm5.4.022

@swensosc
Copy link
Contributor Author

swensosc commented Mar 6, 2026 via email

@ekluzek
Copy link
Collaborator

ekluzek commented Mar 6, 2026

gnu tests are now working. And the same tests fail as for #3391 with only one new additional one:

SETPARAMFILE_Ld5.f10_f10_mg37.I1850Clm60BgcCrujra.derecho_gnu.clm-default

but we won't worry about that for now.

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

Labels

bfb bit-for-bit blocked: dependency Wait to work on this until dependency is resolved enhancement new capability or improved behavior of existing capability science Enhancement to or bug impacting science

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

5 participants