Skip to content

Conversation

@manishvenu
Copy link
Collaborator

@manishvenu manishvenu commented Oct 23, 2025

Problem:
https://github.com/CROCODILE-CESM/CrocoDash uses VisualCaseGen for case creation for regional domains. As such, we follow a similar workflow of checking out a CESM sandbox to generate cases. However, VisualCaseGen installs with a CESM sandbox that is directly connected to it. CrocoDash does not need all of the functionality that visualCaseGen comes with, and doesn't necessarily need the user to install a CESM sandbox -> they should be able to use anybody's sandbox.

However, VCG creates cases by creating - just like a compset alias - a grid alias for the custom regional cases CrocoDash needs. This is done by editing two files in CESM inside of a folder called ccs_config: modelgrid_aliases & component_grids_noupc. How it works is that the aliases are saved inside the modelgrid_aliases, and those have shortnames pointing to specific components grids in the component_grids_noupc file. VisualCaseGen adds a new alias per case into the modelgrid_aliases, and adds any necessary new grids to the component_grids_noupc folder.

Editing these files requires write permission for the user, so it blocks CrocoDash users from using other's sandbox by default (they have to be given permission). It also could be argued that adding the grids to the CESM makes it more confusing for the users, because the grids aren't directly pointed to in the case but in the CESM, but that's just my opinion. This PR only springs up because Mike didn't like the idea of CrocoDash editing CESM sandboxes.

So, to solve this issue, VisualCaseGen needs to create cases without editing CESM sandboxes.

Choices/Changes Made:
One choice that was made was not to use grid long names. Grids, like compsets, can be specified with long names instead of aliases. However, I learned you have to specify the entire longname, including runoff, wave, glc,etc.. grids and not just specify some that you know. The alias method allows you to take advantage of defaults. For example, if you specify DROF, the corresponding grid is selected without having to point to a specific grid manually. VisualCaseGen only touches the atm, lnd, and ocn grids, so it's not realistic (even though it would probably be slightly cleaner) to specify the grid long names, because then we would need infrastructure to specify every component grid, which is not currently supported (It wouldn't be that hard, but it's a lot of extra overhead for a usecase that's not even part of the GUI). It's also not flexible to new components/compset definitions and you lose all of the CIME support for flexible creating your grids from the compsets.

So the choice that was made is: We're gonna need at least one alias!! So if we call in "visualCaseGen_Custom" and specify dummy values for the components that visualCaseGen does touch in custom mode, which is atm, lnd, and ocn. We let CIME handle the runoff, glc, wav, etc.. grids through the compset.

So by default the ocn grid is set to "visualCaseGen_Custom" , which is a 1by1 grid with a random mesh, the atm, and lnd are None. The atm/lnd grid are unset when the case is created with create_newcase. Immeditately after that, we introduce a new function called _update_grids, which replaces the previous edits to ccs_config with xml changes. We set the atm and lnd grids (xml vars {COMP}_GRID) to the cvars variable CUSTOM_{COMP}_GRID (which I don't understand that well). Because setting the {COMP}_GRID variable doesn't change the associated mesh for atm&lnd, we use the self._cime object to set the {COMP}_DOMAIN_MESH xml variable as well for atm, ocn, and lnd.

We don't change the OCN_GRID variable because it is not out of the box in the way atm/lnd are, it is truly visualCaseGen_Custom

Formal Changes (TLDR):

  1. Replace the ccs_config edit functions in the case_creator with an xml variable grid change function called _update_grids
  2. Edit the comments and revert_launch function to reflect this change
  3. A CESM edit will be needed to add a visualCaseGen_Custom to modelgrid_aliases & component_grids_noupc
# In modelgrid_aliases
  <model_grid alias="visualCaseGen_Custom">
    <grid name="ocnice">visualCaseGen_Custom</grid>
  </model_grid>

# In Component_grids
<domain name="visualCaseGen_Custom">
    <nx>1</nx>
    <ny>1</ny>
    <mesh>(IDK LIKE AN EMPTY MESH PATH)</mesh>
    <desc>Empty Grid for VCG Edits</desc>
  </domain>

Outstanding Issues:

  1. I have no experience working with atm/lnd grids, so I'm not sure if this is right. I'm working on this from the lens of CrocoDash, so I don't quite know if I've missed something here (I don't think so!). I am happy to run any additional tests if anyone has any recommendations.
  2. Not backwards compatible UNLESS we use an already existing alias like ww3a (because the alias doesn't matter we can use anything )

CrocoDash case with this PR Coupler history: /glade/u/home/manishrv/scratch/archive/test.4.vcg.xmlchange/cpl/hist

@manishvenu manishvenu marked this pull request as ready for review October 27, 2025 17:44
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.

2 participants