Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine how to handle user_nl_cism for multiple ice sheets #50

Closed
billsacks opened this issue Dec 23, 2020 · 8 comments
Closed

Determine how to handle user_nl_cism for multiple ice sheets #50

billsacks opened this issue Dec 23, 2020 · 8 comments

Comments

@billsacks
Copy link
Member

I can see three options for supporting multiple ice sheets in user_nl_cism, and would like feedback on which method people prefer:

(1) Have multiple user_nl_cism files, like user_nl_cism_gris, user_nl_cism_ais, etc.

This feels relatively easy to use for the user. However, it would require changing some of the cime scripting to be aware of the multiple ice sheets. I think the relevant cime code is pretty limited, but this might be hard to do in a way that keeps cime compatible with e3sm and other modeling systems and keeps it easy to introduce new ice sheets (Laurentide, etc.) without changing cime.

I'd say on this: If people strongly prefer this approach, I can give some thought to how to implement it without tying cime too tightly with CISM, but if other alternatives seem about as good, then maybe we should drop this one to avoid the need for these cime changes.

(2) Have a single user_nl_cism file, with sections for the different ice sheets

I'm imagining something like:

[gris]
foo = value1
bar = value2

[ais]
foo = value3
baz = value4

possibly with an extra section for [all] that would apply to all ice sheets. We could then have a little code in CISM's python scripting that separates this file into temporary files for each ice sheet (containing that ice sheet's section and anything in the [all] section), with a check to confirm that nothing appears before the first section.

It would be easy to have the original user_nl_cism file that is staged in your case directory already have the necessary sections for all possible ice sheets (though I think it would be hard to make it smart enough to have only the section headings for the ice sheets you're running with – that gets back to the need to change cime). i.e., you would start with a file like:

[all]
! Settings that apply to all ice sheets go here

[gris]
! Settings that apply to Greenland (if present) go here

[ais]
! Settings that apply to Antarctica (if present) go here

A possible downside of this approach is that, if user_nl_cism gets long, I could see the potential for accidentally adding a setting in the wrong section.

(3) Have a single user_nl_cism file, with prefixes for each ice sheet.

I'm imagining something like:

gris: foo = value1
gris: bar = value2

ais: foo = value3
ais: baz = value4

The order wouldn't matter here: you could interleave gris and ais settings. As with (2), we could also support 'all'.

This requires more typing for the user than the other approaches, and it seems slightly less intuitive: they'd need to read a bit of documentation. But that documentation can appear in comments at the top of the file. An advantage relative to (2) is that it feels harder to make a mistake with this approach.

@whlipscomb @mvertens @gunterl @Katetc Do you have preferences between these, or ideas for a different approach?

@billsacks billsacks added this to Needs prioritization in Enable alternative and multiple ice sheets via automation Dec 23, 2020
@billsacks billsacks moved this from Needs prioritization to To do in Enable alternative and multiple ice sheets Dec 23, 2020
@billsacks
Copy link
Member Author

A variation on (2) and (3) is: Any variable that appears before the first ice sheet-specific section (for (2)) or without a prefix (for (3)) applies to all ice sheets. The advantages of this is that it is backwards compatible with existing user_nl_cism files and it keeps things simple for cases with a single ice sheet. A disadvantage is that it may be more error-prone: a user may accidentally have some setting apply to all ice sheets when they mean for it to just apply to one.

Another possibility would be to allow that usage when running with a single ice sheet, but not when running with multiple ice sheets. This avoids the above disadvantage, but results in some inconsistency between the single and multiple ice sheet cases that may be a bit confusing for users: sometimes it seems best to be consistent, even if that means that things are a little more complicated in the simple case.

@whlipscomb
Copy link
Contributor

@billsacks - Thanks for thoughtfully laying out the possibilities. I'm leaning toward (2) with your suggested variation, that any variables appearing before the first ice-sheet-specific section will apply to all ice sheets. After that, there would be headings for each supported ice sheet: [gris], [ais], etc., under which users could add ice-sheet-specific settings under each heading. I like that this approach would be backward-compatible and would allow all changes to go in one namelist file.

Happy holidays!

@billsacks
Copy link
Member Author

I just talked to @mvertens about this and she agrees with @whlipscomb 's comment above. (If it weren't for the backwards compatibility piece, she would prefer the explicit [all], but she likes the idea of keeping this backwards compatible.)

billsacks added a commit that referenced this issue Mar 2, 2021
Add icesheet to compset & support alternative/multiple cism.config files

Purpose of changes:

This tag takes two significant steps towards the support of alternative
and multiple ice sheets:

(1) It adds an ice sheet designation in the compset name. Now Greenland
    compsets will have `CISM2%GRIS-EVOLVE`, Antarctica
    `CISM2%AIS-EVOLVE` (not yet functional, but I have added this to the
    compset definition file for illustrative purposes and so that I
    could do some initial testing) and compsets with both icesheets will
    have `CISM2%AIS-EVOLVE%GRIS-EVOLVE`. (`NOEVOLVE` is also an option
    for all of those.) I have done this in a backwards-compatible way so
    that compsets without `%AIS` or `%GRIS` (as are still defined in
    CTSM, CAM and CESM) imply `%GRIS`. (We can remove this backwards
    compatibility once all of the CESM components have switched to the
    new, explicit compset definition.) As discussed in #39, I have
    changed T1850G to T1850Gg.

(2) It reworks buildnml to support the generation of multiple
    cism.config files, each with their own default values for some
    config items. The generated cism.config files now have a name
    designating the ice sheet for which they apply, so we have
    `cism.gris.config` and/or `cism.ais.config`. For now, anything in
    `user_nl_cism` applies to all ice sheets, but eventually we'll add a
    way to make settings for just one ice sheet (see #50).

Also some minor changes:

(3) A small change in the mct cap that is unrelated to the rest of this
    PR: it is something that @whlipscomb and I discussed a few months
    ago.

(4) Point to new location for Greenland init files

(5) Fix check_input_data integration (#55)

- Resolves #39 (Add an explicit "Greenland" designation
  in the compset name)
- Resolves #55 (In cism2_1_75, CISM's
  check_input_data integration is broken)
@billsacks
Copy link
Member Author

Closing this discussion issue; opening an issue to actually do the work: ESMCI/cime#3999

Enable alternative and multiple ice sheets automation moved this from To do to Done Jun 15, 2021
@jedwards4b
Copy link
Contributor

I don't see the difficulty with (1) - most of the changes would be in the cism buildnml file and not in cime.

@whlipscomb
Copy link
Contributor

One issue is that we'll eventually want to support multiple paleo ice sheets: Laurentide, Eurasian, Fennoscandian, and so on. In addition to Greenland (gris) and Antarctica (ais), we'd have to carry around other user_nl_* files for ice sheets that are irrelevant to most people running the model.

@billsacks billsacks reopened this Jun 15, 2021
Enable alternative and multiple ice sheets automation moved this from Done to In progress Jun 15, 2021
@billsacks
Copy link
Member Author

To avoid having two separate threads, let's move this discussion to ESMCI/cime#3999 so it gets more attention from CIME folks who may want to weigh in.

Enable alternative and multiple ice sheets automation moved this from In progress to Done Jun 15, 2021
@billsacks
Copy link
Member Author

For anyone interested in this issue: please see my latest comment in the CIME issue, ESMCI/cime#3999 (comment), where I propose option (1) (following @jedwards4b 's suggestion) after all, if people are happy with that.

jedwards4b added a commit to jedwards4b/cism-wrapper that referenced this issue Jul 5, 2024
jedwards4b added a commit to jedwards4b/cism-wrapper that referenced this issue Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

No branches or pull requests

6 participants