Skip to content

Cloudlab case - #210

Open
pdziekan wants to merge 7 commits into
igfuw:masterfrom
pdziekan:CLOUDLAB
Open

pdziekan wants to merge 7 commits into
igfuw:masterfrom
pdziekan:CLOUDLAB

Conversation

@pdziekan

Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI lite review requested due to automatic review settings August 31, 2026 09:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new “cloudlab” model case and introduces a mechanism for cases to update runtime options on a per-timestep basis (used to control microphysics options like the aerosol source), alongside a few microphysics/diagnostic tweaks.

Changes:

  • Add new cloudlab case implementation and register it in the runtime case selector.
  • Add a per-timestep case hook (CasesCommon::setopts(rt_params_t&, int timestep)) and plumbing to invoke it from solvers before each timestep.
  • Extend Lagrangian diagnostics (additional wet moments) and expose a depo CLI option for Lagrangian microphysics.

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/solvers/slvr_lgrngn.hpp Adds per-timestep setopts_ante_step() override that delegates to a runtime callback.
src/solvers/slvr_common.hpp Splits pre-step logic into hook_ante_step() + virtual setopts_ante_step().
src/solvers/lgrngn/hook_mixed_rhs_ante_step_lgrngn.hpp Alters handling of cloudph_opts.src after the first step.
src/solvers/lgrngn/hook_ante_step_lgrngn.hpp Adds (commented-out) debug scaffolding.
src/solvers/lgrngn/hook_ante_loop_lgrngn.hpp Tweaks source enabling and increases n_sd_max headroom; records source bounds.
src/solvers/lgrngn/diag_lgrngn.hpp Records additional wet-moment diagnostics for cloud/rain drops.
src/solvers/blk_2m/slvr_blk_2m_common.hpp Adds per-timestep setopts_ante_step() override + runtime callback field.
src/solvers/blk_1m/slvr_blk_1m_common.hpp Adds per-timestep setopts_ante_step() override + runtime callback field.
src/run_hlpr.cpp Registers the new cloudlab case and wires case per-timestep option updates into params.
src/opts/opts_lgrngn.hpp Adds depo option to the Lagrangian microphysics option parsing.
src/cases/CLOUDLAB.hpp Implements the Cloudlab case and per-timestep seeding/source control.
src/cases/CasesCommon.hpp Adds a new virtual setopts(rt_params_t&, int timestep) hook for cases.
Suppressed comments (4)

src/solvers/lgrngn/hook_mixed_rhs_ante_step_lgrngn.hpp:70

  • params.cloudph_opts.src is no longer disabled after it is used for GCCN initialization. With gccn > 0 this leaves the aerosol source enabled for the rest of the run (and likely explodes SD count / changes physics). Restore the original src=false switch-off here; the new per-timestep case hook can still re-enable it later when needed (e.g., for Cloudlab seeding).
    if(this->timestep == 1)
    {
      // turn off aerosol src, because it was only used to initialize gccn below some height
      // params.cloudph_opts.src = false;
      // if relaxation is to be done, turn it on after gccn were created by src
      if(params.user_params.relax_ccn)
        params.cloudph_opts.rlx = true;
    }

src/solvers/lgrngn/diag_lgrngn.hpp:150

  • Comment is incorrect: this records diag_wet_mom(2) (2nd moment), not "0th" moment.
  // recording 0th wet mom of radius of rain drops (r>25um)
  prtcls->diag_wet_rng(25.e-6, 1);
  prtcls->diag_wet_mom(2);
  this->record_aux("rain_rw_mom2", prtcls->outbuf());

src/solvers/lgrngn/diag_lgrngn.hpp:165

  • Comment is incorrect: this records diag_wet_mom(1) (1st moment), not "0th" moment.
  // recording 0th wet mom of radius of cloud drops (.5um< r < 25um)
  prtcls->diag_wet_rng(.5e-6, 25.e-6);
  prtcls->diag_wet_mom(1);
  this->record_aux("cloud_rw_mom1", prtcls->outbuf());

src/solvers/lgrngn/diag_lgrngn.hpp:170

  • Comment is incorrect: this records diag_wet_mom(2) (2nd moment), not "0th" moment.
  // recording 0th wet mom of radius of cloud drops (.5um< r < 25um)
  prtcls->diag_wet_rng(.5e-6, 25.e-6);
  prtcls->diag_wet_mom(2);
  this->record_aux("cloud_rw_mom2", prtcls->outbuf());

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/run_hlpr.cpp
Comment on lines +137 to +140
p.setopts_ante_step = [case_instance = case_ptr.get()](rt_params_t &params, const int timestep)
{
case_instance->setopts(params, timestep);
};
Comment on lines +110 to +114
void setopts_ante_step() override
{
params.setopts_ante_step(params, this->timestep);
parent_t::setopts_ante_step();
}
Comment on lines +156 to +160
void setopts_ante_step() override
{
params.setopts_ante_step(params, this->timestep);
parent_t::setopts_ante_step();
}
Comment on lines +164 to +168
void setopts_ante_step() override
{
params.setopts_ante_step(params, this->timestep);
parent_t::setopts_ante_step();
}
Comment on lines 126 to +131
// space for SD created via relaxation, impossible to know exactly how many will be added, because it depends on washout of SD...
int n_sd_from_rlx_dry_distros = params.cloudph_opts_init.rlx_sd_per_bin * params.cloudph_opts_init.rlx_bins * params.cloudph_opts_init.nz * 100; // room for 100 rounds of full relaxation...
params.cloudph_opts_init.n_sd_max += n_sd_from_rlx_dry_distros;

params.cloudph_opts_init.n_sd_max += 1e6; // temporary for source

Comment on lines +142 to +146
// recording 1th wet mom of radius of rain drops (r>25um)
prtcls->diag_wet_rng(25.e-6, 1);
prtcls->diag_wet_mom(1);
this->record_aux("rain_rw_mom1", prtcls->outbuf());

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