-
Notifications
You must be signed in to change notification settings - Fork 4
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
order update aux - fuse loops #507
Conversation
4800ea2
to
70d1f76
Compare
aux_gm.q_liq[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.q_liq[k] + (1 - aux_tc.bulk.area[k]) * aux_en.q_liq[k]) | ||
aux_gm.q_ice[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.q_ice[k] + (1 - aux_tc.bulk.area[k]) * aux_en.q_ice[k]) | ||
aux_gm.T[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.T[k] + (1 - aux_tc.bulk.area[k]) * aux_en.T[k]) | ||
aux_gm.buoy[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.buoy[k] + (1 - aux_tc.bulk.area[k]) * aux_en.buoy[k]) |
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.
Isn't this already computed above?
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 you referring to 'aux_gm.buoy[k]', its a question of which "aux_gm.buoy[k]" we would like to keep.
the RHS of this expression
aux_gm.buoy[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.buoy[k] + (1 - aux_tc.bulk.area[k]) * aux_en.buoy[k])
is changed in 133-139 after 'aux_gm.buoy[k]' was computed the first time. Therefore 'aux_gm.buoy[k]' is recomputed here.
All other grid mean variables in these lines are computed only here
aux_gm.q_liq[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.q_liq[k] + (1 - aux_tc.bulk.area[k]) * aux_en.q_liq[k]) | ||
aux_gm.q_ice[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.q_ice[k] + (1 - aux_tc.bulk.area[k]) * aux_en.q_ice[k]) | ||
aux_gm.T[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.T[k] + (1 - aux_tc.bulk.area[k]) * aux_en.T[k]) | ||
aux_gm.buoy[k] = (aux_tc.bulk.area[k] * aux_tc.bulk.buoy[k] + (1 - aux_tc.bulk.area[k]) * aux_en.buoy[k]) |
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.
Not a blocker (I know that we're currently already doing this), but why aren't we using thermodynamics to compute these from grid mean quantities? Isn't that what the dycore will do without edmf?
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.
It is a great point. in theory the updraft and environment are not well mixed so better compute their individual thermodynamic states and get the temperature as area weighted mean. However I am not sure what the dycore will do, it should be discussed in the future.
70d1f76
to
b5e15fa
Compare
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.
Overall the code changes look fine to me. It would be nice to get a second set of eyes on this PR, though, since update_aux!
is pretty intricate.
anew_k = interpc2f(aux_up[i].area, grid, k; a_up_bcs...) | ||
if anew_k >= edmf.minimum_area | ||
aux_up_f[i].w[k] = max(prog_up_f[i].ρaw[k] / (ρ0_f[k] * anew_k), 0) | ||
if is_surface_center(grid, k) |
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.
Would it make sense to fill out the surface points separately. And then loop over updrafts starting from the first point above the ground?
This way we would avoid checking an if/else for every height point in this loop
if anew_k >= edmf.minimum_area | ||
aux_up_f[i].w[k] = max(prog_up_f[i].ρaw[k] / (ρ0_f[k] * anew_k), 0) | ||
if is_surface_center(grid, k) | ||
if prog_up[i].ρarea[k] / ρ0_c[k] >= edmf.minimum_area |
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.
Great to use some common minimum area!
b5e15fa
to
518aaf7
Compare
Bors r+ |
Build succeeded: |
511: Use relaxation to LES profiles + define initial conditions more precisely for LES_driven_SCM r=costachris a=costachris Addresses points 4, 7 from #505. Averages 1 hour window around `t_end` - 6 hours for initial conditions. `thetali` and `qt` are relaxed to the mean LES profile following eqn 9 in Shen et al. 2021 Co-authored-by: costachris <christopouloscosta@gmail.com>
This PR organizes update_aux in order to prevent issues of using aux vars from from previous time steps, fuse k loops and follow this general order:
I separated the face and center updates in order to reduce the number of loops from each case