Skip to content

Commit

Permalink
Add notes on registry vs. .meta file
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmielin committed Nov 5, 2024
1 parent 4cd358b commit bb4731a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/conversion/check-metadata.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ If the variable in question cannot be tracked back to a “use” statement or a
!!! Note - registry variables
Variables in the registry are read in from the initial data file by default.

!!! Note - registry or scheme?
**Should I add a variable to the registry or rely on CCPP to manage the variables being passed between schemes?** While declaring a variable in the scheme metadata files allows CCPP to pass this variable from a scheme and to another scheme without having to define it in the registry, it is important to note that variables not declared in the registry are not preserved between timesteps (i.e., the timestep initialization phase will reallocate these variables). Thus variables that should be preserved as part of model "state" or (formerly) physics buffer variables with time dimensions (e.g., total energy at end of previous physics timestep) should be included as part of the registry.

There are two options for registry variables:

1. Variable read in from the initial data file: no action required
1. Variable not read in from the initial data file, and instead intialized during CAM-SIMA initialization. You will need to add code to do this:
2. Variable not read in from the initial data file, and instead initialized during CAM-SIMA initialization. You will need to add code to do this:
- Determine the best place to initialize this variable (has to occur at some point during initialization - see [CAM-SIMA run](../design/cam-run-process.md/#cam_init)
- In the location you have chosen, add the use statements below to import the registry variable from the auto-generated fortran AND the mark_as_initialized routine
- After adding the code to initialize the variable, add the `mark_as_initialized` call below to indicate that that variable should NOT be read in from the file.
Expand All @@ -128,4 +131,4 @@ The units you are using for a variable in your converted scheme has a different
- If it seems like the automatic unit converter should be able to handle the unit conversion, talk to Courtney
- If it’s more of a one-off conversion, two options remain:
1. Write an interstitial for the unit conversion
2. Include the conversion in the scheme code (you will also need to update the CAM interface to make sure it’s passing in the same units as the CAM-SIMA host has)
2. Include the conversion in the scheme code (you will also need to update the CAM interface to make sure it’s passing in the same units as the CAM-SIMA host has)

0 comments on commit bb4731a

Please sign in to comment.