CliMA / ClimaAtmos.jl

ClimaAtmos.jl is a library for building atmospheric circulation models that is designed from the outset to leverage data assimilation and machine learning tools. We welcome contributions!
Apache License 2.0
82 stars 16 forks source link

Test the SSP timestepper #1310

Closed valeriabarra closed 3 months ago

valeriabarra commented 1 year ago

The Climate Modeling Alliance

Software Design Issue 📜

Purpose

The purpose of this SDI is to test the new SSP 333 time-stepper in ClimaAtmos.

Cost/Benefits/Risks

Cost: @valeriabarra 's 60% time

Benefits: The time stepper, limiters, and vertical upwinding operators will be adjudged fit for purpose. Test coverage of the code will increase. Quality assurance will be performed and reported on.

Risks: Lack of simpler, incremental examples in the upstream repo. There is not currently a working spherical 3D simple example that uses the new SSP algorithm yet in ClimaTimeSteppers (only a 2D one). Documentation of the new interfaces is a bit lacking and scattered.

People and Personnel

Components

Part 1: Test SSP

In order for us to test the new SSP algorithm, we first need to

Part 2: Test different upwinding modes with SSP

For Config 5, we need to modify the upwinding mode for density and add support for upwinding density (CLI option: --density_upwinding) with the different upwinding modes (similar to --energy_upwinding and --tracer_upwinding).

Part 3: Test different upwinding modes with SSP and topography

Part 2 consists of 3 different integration tests x 5 configurations each, without and with topography. That's a total of 30 experiments.

Inputs

Plan No. 102 from @cmbengue , plus additional inputs from @szy21 and others as needed.

Results and Deliverables

Task Breakdown And Schedule

Part 1:

Part 2, no topography:

Part 3, with topography: (available when topography tests have been ironed out)

SDI Revision Log

@szy21

CC

@tapios @simonbyrne @cmbengue

Expected date of completion: March 13

szy21 commented 1 year ago

Looks good, thanks! @tapios may have some comments on the flux correction. Tapio also mentions that we want to test it with topography, but that depends on when we have the topography runs in the ci. We should have them ready in 1-2 weeks, and can add those tests in this SDI or open a new one.

tapios commented 1 year ago

Yes, the 3rd-order upwinding should always include the flux correction. And we should include a topography test in all of this as soon as we have it.

valeriabarra commented 1 year ago

Yes, the 3rd-order upwinding should always include the flux correction.

Sorry @tapios , I need a clarification. We have different upwinding modes (each for upwinding energy and upwinding tracers). The flux-correction is one of the modes, but it is not included in the 3rd-order mode. Namely, we currently can specify --energy_upwinding and --tracer_upwinding and each of them can be either set to none (default, i.e. second-order), first_order , third_order, boris_book, or zalesak.

Do you want me to add another configuration to the configs above, basically: Config 5: Config 4 amended as follows: zalesak vertical upwinding ON (instead of the 3rd order one) ?

tapios commented 1 year ago

Config 4 should be 3rd-order upwinding with Zalesak flux correction for tracers (specific humidity).

It would be helpful to add a config 5 with 3rd-order upwinding (with flux correction) for density, energy, and tracers.

szy21 commented 1 year ago

I forgot to add that Tapio mentioned that for simulations with source and sink of moisture (e.g. 0-moment microphysics), we need to have the relaxation timescale larger than timestep in order to ensure positivity.

valeriabarra commented 1 year ago

I forgot to add that Tapio mentioned that for simulations with source and sink of moisture (e.g. 0-moment microphysics), we need to have the relaxation timescale larger than timestep in order to ensure positivity.

Note to self: If needed, that would mean change the τ_precip in examples/hybrid/parameter_set.jl to use some τ_precip > dt.

szy21 commented 1 year ago

Here is the list of figures we want (I will try to keep the list up-to-date):

For moist baroclinic waves (ref):

For moist Held-Suarez and aquaplanet simulations (ref for moist Held-Suarez)

valeriabarra commented 1 year ago

@tapios , for Config 2, we need a clarification. Do the horizontal limiters apply only to the tracers (ρq_tot and other tracers) or also to ρe_tot (which depends on q)?

tapios commented 1 year ago

Just tracers for now. (Later, we may want to test monotonicity, but not positivity, preserving limiters on energy too, but this doesn't need to be now.)

valeriabarra commented 1 year ago

Can anyone (@tapios and/or @cmbengue) formally approve this SDI for execution or request changes (if needed)? If anything different is expected, for instance (e.g. a separate script to produce results instead of the production of the results via our CI pipeline), please clarify. Thank you.

tapios commented 1 year ago

This looks good to me.

One further clarification: For 5), once we have upwinding for density and energy, we should also have horizontal limiters (monotonicity preserving) for them.

valeriabarra commented 1 year ago

Thanks @tapios . I need a further clarification.

In the hyperdiffusion tendency (please see these lines of code) we subtract the change in ρq_tot from both ρq_tot and ρ. Therefore, if we only limit ρq_tot it seems to me like we won't have the correct conservation of mass from ρ anymore. Is this understanding is correct? If so, we will have to discuss how to mitigate this. Thanks

tapios commented 1 year ago

Yes, this is to correct locally for mass tendencies owing to hyperdiffusion. (It would be better to call ᶜχρq_tot something like ᶜχq_tot, since it does not include the density factor.)

If you have the moisture tendency from the limiter, you can also add it in the continuity equation. If not, don't worry about it. It's just a local redistribution, which is tiny. It will not affect the integrated mass balance.

valeriabarra commented 1 year ago

As of today, 04/07, the tests without topography have been completed as requested.

Issues have been opened for the failing test cases:

valeriabarra commented 1 year ago

I was asked to compare the time-to-solution of SSP333 and ARS343 for the dry baroclinic wave test case, using the same resolution as in the Gardner paper (). I reported on the results in this comment in Issue #1573 . SSP333 is only 7% slower than ARS343 for the dry BW test case in consideration.

charleskawczynski commented 1 year ago

@valeriabarra, any updates on this issue?

valeriabarra commented 1 year ago
szy21 commented 3 months ago

Superseded by most recent issues on the timestepper.