-
Notifications
You must be signed in to change notification settings - Fork 2
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
P3 skeleton framework #185
Conversation
@sajjadazimi I've just tagged you for review on this PR—I haven't added tests for P3 and have not squashed/rebased yet, but I'm hoping to get your feedback on the code as I prepare to merge this. Thanks!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
It looks good to me. I left some small comments.
src/Common/tendency.jl
Outdated
@. θ_liq_ice = TD.liquid_ice_pottemp(thermo_params, ts) | ||
@. θ_liq_ice = θ_dry #TD.liquid_ice_pottemp(thermo_params, ts) - prevents error... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the fact that we are running it with q_vap = 0 is the problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just changed it back to using θ_liq_ice from Thermodynamics, and no error! So whatever was causing it when I originally commented it out must be fixed now
src/K1DModel/tendency.jl
Outdated
) | ||
@. dY.N_aer += -∂(aux.prescribed_velocity.ρw / If(aux.thermo_variables.ρ) * If(Y.N_aer)) | ||
|
||
if Bool(aux.kid_params.qtot_flux_correction) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this condition. Always apply fcc here
src/K1DModel/tendency.jl
Outdated
_q_flux = FT(0.65e-4) | ||
_N_flux = FT(40000) | ||
_F_rim = FT(0.2) | ||
_F_liq = FT(0.2) | ||
_ρ_r_init = FT(900) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should not be hardcoded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right—thanks. Would it be acceptable to add them as elements of the PrecipitationP3 struct that can be initialized in run_KiD_simulation? If so, would the best place be to add them as command line arguments in parse_commandline? Otherwise, I could add them in aux as command line arguments as well. Maybe a command line argument that is used in aux could be the cleanest way to do it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think they would fit better in the case setup. Since they only come about because the case specifies the top fluxes. In an actual simulation we would make sure that our domain is high enough that we don't have to worry about anything else falling in
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
src/K1DModel/tendency.jl
Outdated
_F_liq = FT(0.2) | ||
_ρ_r_init = FT(900) | ||
|
||
_flux = FT(0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
# commenting here the configuration which has been used for p3: | ||
# config["precipitation_choice"] = "PrecipitationP3" | ||
# config["moisture_choice"] = "MoistureP3" | ||
# config["n_elem"] = 24 | ||
# config["z_max"] = 3000 | ||
# config["t_end"] = 75 | ||
# config["w1"] = 0 | ||
# config["rv_0"] = 0 | ||
# config["rv_1"] = 0 | ||
# config["rv_2"] = 0 | ||
# config["dt"] = Float64(0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines should be removed before merging
src/Common/initial_condition.jl
Outdated
N_rai::FT = FT(0) | ||
|
||
# q_tot - single p3 category + 2M categories | ||
q_tot::FT = q_ice + q_liq + q_rai |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we could add some water vapor to this setup. Such that q_tot = q_vap + q_liq + q_ice?
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah—update: I could also use the same profile of water vapor which I just noticed that's used in the normal 1D testing setup. I'm guessing that would be the best way forward.
# config["dt"] = Float64(0.5) | ||
cloudy_params = nothing | ||
init = map( | ||
coord -> CO.p3_initial_condition( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do we need a special case for the P3 scheme? Could it be handled in the same way as other bulk microphysics cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if we want to initialize particles with specific P3 properties, we have to have another initial condition function, and in that initial condition, we specify our own temperature and pressure gradients, and we can add vapor pressure, etc. In the future we could try other initial conditions, but maybe for now this way is easiest for testing if you agree?
Could we also add this case to our buildkite jobs: https://github.com/CliMA/KinematicDriver.jl/blob/main/.buildkite/pipeline.yml |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #185 +/- ##
==========================================
- Coverage 80.82% 78.96% -1.86%
==========================================
Files 28 28
Lines 1945 2225 +280
==========================================
+ Hits 1572 1757 +185
- Misses 373 468 +95 ☔ View full report in Codecov by Sentry. |
This PR aims to add compatibility in KiD to test the 1D framework described in case 1 of Cholette et al 2019 using P3.
Only P3 terminal velocity is included with this PR.
For future reference, the configuration I've been using for testing is as follows:
Note: the
p3_boundary_condition
command line argument controls whether we use an initial signal of ice or we introduce ice mass via the boundary, and the same argument is also used to customize the characteristics of the initial/boundary condition particles.