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

Use new way of handling clima parameters #68

Merged
merged 1 commit into from
Jun 25, 2022
Merged

Use new way of handling clima parameters #68

merged 1 commit into from
Jun 25, 2022

Conversation

charleskawczynski
Copy link
Member

@charleskawczynski charleskawczynski commented Jun 20, 2022

This PR applies the new way of handling clima parameters:

  • Adds a package module, Parameters, where we define a struct specifically for this packages parameters.
  • The struct from this module is then used in all places where we originally called CLIMAParameter methods (e.g., Planet.grav(param_set) becomes Parameters.grav(param_set), and I've added some aliases so that this is a bit more terse
  • Removes the use of CLIMAParameters in src/ completely
  • Adds a folder, parameters to the top-level package, where a parameter-creating function was added, which constructs the struct instance that houses all of the necessary parameters are need (from this package, and its dependencies).

@kmdeck
Copy link
Collaborator

kmdeck commented Jun 25, 2022

This looks fine to me, Charlie! Thanks for upgrading.

In this, it seems like we'll have LSMParameters holding the physical constants for other modules (surface fluxes, TD) as well as planet params, and then each specific model may introduce its own specific params (soil type, etc) and create a bigger struct like

MyModelParams

  • model specific params in flat list
  • earth_param_set = LSMParameters()

We can discuss more if this makes sense or if the whole thing should be a flat list?

I am going to go ahead and merge this, because to use the latest ClimaAtmos (with the hot fixes @szy21 and @jiahe23 pushed) in coupled sims, we also need to be using the latest parameters style in the land model.

@kmdeck kmdeck linked an issue Jun 25, 2022 that may be closed by this pull request
@kmdeck
Copy link
Collaborator

kmdeck commented Jun 25, 2022

bors r+

@bors
Copy link
Contributor

bors bot commented Jun 25, 2022

@bors bors bot merged commit 6eb24d9 into main Jun 25, 2022
@bors bors bot deleted the ck/climaparams branch June 25, 2022 14:49
mitraA90 pushed a commit that referenced this pull request Dec 22, 2023
68: Use new way of handling clima parameters r=kmdeck a=charleskawczynski

This PR applies the new way of handling clima parameters:
 - Adds a package module, `Parameters`, where we define a struct specifically for this packages parameters.
 - The struct from this module is then used in all places where we originally called CLIMAParameter methods (e.g., `Planet.grav(param_set)` becomes `Parameters.grav(param_set)`, and I've added some aliases so that this is a bit more terse
 - Removes the use of CLIMAParameters in `src/` completely
 - Adds a folder, `parameters` to the top-level package, where a parameter-creating function was added, which constructs the struct instance that houses all of the necessary parameters are need (from this package, and its dependencies).


Co-authored-by: Charles Kawczynski <kawczynski.charles@gmail.com>
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.

Better handling of params from CLIMAParameters
2 participants