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

DYAMOND Summer low-resolution simulation #3458

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

sriharshakandala
Copy link
Member

@sriharshakandala sriharshakandala commented Nov 26, 2024

Purpose

Add DYAMOND Summer low-resolution simulation.

To-do

Content


  • I have read and checked the items on the review checklist.

@sriharshakandala sriharshakandala marked this pull request as draft November 26, 2024 18:51
@sriharshakandala sriharshakandala changed the title Initial conditions from file (rough draft, work-in-progress) Initial conditions from file Nov 26, 2024
@sriharshakandala sriharshakandala force-pushed the sk/dyamond_summer_ics branch 3 times, most recently from 9471246 to f63259b Compare November 26, 2024 19:54
src/solver/type_getters.jl Outdated Show resolved Hide resolved
@sriharshakandala sriharshakandala changed the title Initial conditions from file DYAMOND Summer low-resolution simulation Nov 27, 2024
@sriharshakandala sriharshakandala changed the title DYAMOND Summer low-resolution simulation DYAMOND Summer low-resolution simulation Nov 27, 2024
src/solver/type_getters.jl Outdated Show resolved Hide resolved
src/solver/type_getters.jl Outdated Show resolved Hide resolved
src/solver/type_getters.jl Outdated Show resolved Hide resolved
@sriharshakandala sriharshakandala force-pushed the sk/dyamond_summer_ics branch 3 times, most recently from 9241853 to fbfedb7 Compare December 12, 2024 23:41
@sriharshakandala sriharshakandala marked this pull request as ready for review December 12, 2024 23:43
Copy link
Member

@Sbozzolo Sbozzolo left a comment

Choose a reason for hiding this comment

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

Could you add documentation before we start looking at the code?

Provides a method that overwrites initial conditions in instances
where initial values are assigned from existing datasets.
(return nothing)

"""
overwrite_initial_conditions!(initial_condition, Y, thermo_params, config)
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Isn't this function recompuing some hydrostatic balance? This should be mentioned and explained somewhere, otherwise how could people understand what's the point of these lines

    ᶜ∂lnp∂z = @. -thermo_params.grav /
       (TD.gas_constant_air(thermo_params, TD.PhasePartition(ᶜq_tot)) * ᶜT)
    ᶠlnp_over_psfc = zeros(face_space)
    Operators.column_integral_indefinite!(ᶠlnp_over_psfc, ᶜ∂lnp∂z)
    ᶠp = p_sfc .* exp.(ᶠlnp_over_psfc)

There is no mention anywhere (code, comments, GitHub) of the challanges you were facing and why this code looks like this instead of just reading the pressure.

Copy link
Member

Choose a reason for hiding this comment

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

Fixed.

(return nothing)

"""
overwrite_initial_conditions!(initial_condition, Y, thermo_params, config)
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this function recompuing some hydrostatic balance? This should be mentioned and explained somewhere, otherwise how could people understand what's the point of these lines

    ᶜ∂lnp∂z = @. -thermo_params.grav /
       (TD.gas_constant_air(thermo_params, TD.PhasePartition(ᶜq_tot)) * ᶜT)
    ᶠlnp_over_psfc = zeros(face_space)
    Operators.column_integral_indefinite!(ᶠlnp_over_psfc, ᶜ∂lnp∂z)
    ᶠp = p_sfc .* exp.(ᶠlnp_over_psfc)

There is no mention anywhere (code, comments, GitHub) of the challanges you were facing and why this code looks like this instead of just reading the pressure.

and populates prognostic variables with interpolated values using the `SpaceVaryingInputs`
tool.
"""
function overwrite_initial_conditions!(
Copy link
Member

Choose a reason for hiding this comment

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

Could you make this function independent of the parsed_args?

src/initial_conditions/initial_conditions.jl Outdated Show resolved Hide resolved
src/initial_conditions/initial_conditions.jl Outdated Show resolved Hide resolved
Comment on lines 268 to 269
elseif parsed_args["initial_condition"] in ["DYAMONDSummer"]
return getproperty(ICs, Symbol(parsed_args["initial_condition"]))()
Copy link
Member

Choose a reason for hiding this comment

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

You can just add DYAMONDSummer to the list below this

NEWS.md Outdated
Comment on lines 10 to 11
Added functionality to allow initial conditions to be overwritten by
interpolated datasets. Currently supports equilibrium moisture models.
Copy link
Member

Choose a reason for hiding this comment

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

Is the intent for the function added to be general, or is it only for the dyamond case?

Copy link
Member

Choose a reason for hiding this comment

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

cc @sriharshakandala Do we wish to maintain this overwrite method for all such future initial condition file-reads? Or is there some way this can be done entirely within the LocalState prescription to avoid such an overwrite ?

Copy link
Member Author

Choose a reason for hiding this comment

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

With this workflow, the user can define a custom overwrite function for each of the supported initial condition types if, for example, they wish to use data from a file for setting up the initial condition.
Currently, this is primarily intended for the DYAMONDSummer simulation which reads initial condition from file. We are planning to refactor the initial condition prescription to separate out

  1. Allocation of prognostic variables and
  2. initialization of prognostic variables
    We plan to address this refactoring in a different PR.

@@ -0,0 +1,30 @@
dt_save_state_to_disk: "Inf"
Copy link
Member

Choose a reason for hiding this comment

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

This feature is not being tested anywere, we should add it to buildkite and maybe add a couple of plots too

Comment on lines +85 to +91
function dyamond_summer_artifact_path(; context = nothing)
filename = "DYAMOND_SUMMER_ICS_p98deg.nc"
return joinpath(
@clima_artifact("DYAMOND_SUMMER_ICS_p98deg", context),
filename,
)
end
Copy link
Member

Choose a reason for hiding this comment

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

Could you add a docstring here with a brief description of this artifact, what it contains, and what's used for?

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.

4 participants