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

Repeated use of model index while fetching mixing ratios. #326

Open
singhbalwinder opened this issue Jun 4, 2024 · 0 comments
Open

Repeated use of model index while fetching mixing ratios. #326

singhbalwinder opened this issue Jun 4, 2024 · 0 comments

Comments

@singhbalwinder
Copy link
Contributor

For getting mixing ratios of a particular species, we sometimes use the index information twice. For example the following code in src/mam4xx/hetfrz.hpp:

const int accum_idx = int(ModeIndex::Accumulation);
  const int pcarbon_idx = int(ModeIndex::PrimaryCarbon);

  auto &accum_bc  = progs.q_aero_i[accum_idx][aerosol_index_for_mode(ModeIndex::Accumulation, AeroId::BC)];

The code above uses ModeIndex::Accumulation twice. We should look into ways to avoid its repeated use.

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

No branches or pull requests

1 participant