Skip to content

Conversation

@glwagner
Copy link
Member

@glwagner glwagner commented Jul 1, 2025

@mmr0 this PR shows how you can add a computation of the averages as a callback to complete the subsidence forcing.

@glwagner glwagner marked this pull request as draft July 1, 2025 13:32
Fu_subsidence = Forcing(u_subsidence, discrete_form=true, parameters=(u_avg=u_avg_f; wˢ))
Fv_subsidence = Forcing(v_subsidence, discrete_form=true, parameters=(v_avg=u_avg_f; wˢ))
Fθ_subsidence = Forcing(θ_subsidence, discrete_form=true, parameters=(θ_avg=u_avg_f; wˢ))
Fq_subsidence = Forcing(q_subsidence, discrete_form=true, parameters=(q_avg=u_avg_f; wˢ))
Copy link
Collaborator

Choose a reason for hiding this comment

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

Fu_subsidence = Forcing(u_subsidence, discrete_form=true, parameters=(;u_avg=u_avg_f, wˢ))
Fv_subsidence = Forcing(v_subsidence, discrete_form=true, parameters=(;v_avg=v_avg_f, wˢ))
Fθ_subsidence = Forcing(θ_subsidence, discrete_form=true, parameters=(;θ_avg=θ_avg_f, wˢ))
Fq_subsidence = Forcing(q_subsidence, discrete_form=true, parameters=(;q_avg=q_avg_f, wˢ))

Found I needed to change the syntax of parameters (otherwise I got an error along the lines of
ERROR: LoadError: type Field has no field wˢ

Also q_avg=u_avg_f is a good way to make lots of clouds!! haha

Copy link
Member

Choose a reason for hiding this comment

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

(u_avg=u_avg_f; wˢ)

seems typo; I think @glwagner was trying to construct a named tuple, e.g., exactly what you suggest above @mmr0

@navidcy
Copy link
Member

navidcy commented Jul 3, 2025

does this PR supersedes #15?

@navidcy navidcy marked this pull request as ready for review July 3, 2025 01:46
@navidcy navidcy requested a review from mmr0 July 3, 2025 01:46
@navidcy
Copy link
Member

navidcy commented Jul 3, 2025

Looks good to me; @mmr0 can you have another look?

@navidcy
Copy link
Member

navidcy commented Jul 4, 2025

This runs on GPU.

This is zeros:

julia> qˡt = FieldTimeSeries("bomex.jld2", "")
128×128×150×61 FieldTimeSeries{InMemory} located at (Center, Center, Center) of qˡ at bomex.jld2
├── grid: 128×128×150 RectilinearGrid{Float64, Periodic, Periodic, Bounded} on CPU with 3×3×3 halo
├── indices: (:, :, :)
├── time_indexing: Linear()
├── backend: InMemory()
├── path: bomex.jld2
├── name: qˡ
└── data: 134×134×156×61 OffsetArray(::Array{Float64, 4}, -2:131, -2:131, -2:153, 1:61) with eltype Float64 with indices -2:131×-2:131×-2:153×1:61
    └── max=0.0, min=0.0, mean=0.0

Is this part of the issue the PR is trying to address?

@glwagner
Copy link
Member Author

glwagner commented Jul 4, 2025

Bomex should have cloud liquid. However, lack of cloud formation may be due to multiple factors. Therefore, this PR just implements one step towards a correct bomex. This PR does not aim to validate bomex. It should be merged if possible so that work can continue on validation.

@navidcy
Copy link
Member

navidcy commented Jul 4, 2025

Let's merge then and continue!

@navidcy navidcy merged commit 20cb3d9 into main Jul 4, 2025
5 checks passed
@giordano giordano deleted the glw/finish-subsidence-calc branch October 24, 2025 00:09
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