-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add face_sw_direct_flux_dn only for AllSkyRadiationWithClearSkyDiagnostics #3339
Conversation
…stics `face_sw_direct_flux_dn` is used only in `AllSkyRadiationWithClearSkyDiagnostics` in this block: ``` NVTX.@Annotate function update_sw_fluxes!( ::AllSkyRadiationWithClearSkyDiagnostics, model, ) RRTMGP.RTESolver.solve_sw!( model.sw_solver, model.as, model.lookups.lookup_sw, nothing, model.lookups.lookup_sw_aero, ) parent(model.face_clear_sw_flux_up) .= parent(model.face_sw_flux_up) parent(model.face_clear_sw_flux_dn) .= parent(model.face_sw_flux_dn) parent(model.face_clear_sw_direct_flux_dn) .= parent(model.face_sw_direct_flux_dn) parent(model.face_clear_sw_flux) .= parent(model.face_sw_flux) RRTMGP.RTESolver.solve_sw!( model.sw_solver, model.as, model.lookups.lookup_sw, model.lookups.lookup_sw_cld, model.lookups.lookup_sw_aero, ) end ``` It is not used by other modes, so I don't add it
Actually, we should have it in other radiation modes as well. Right now for other radiation modes, p.radiation.rrtmgp_model.model.face_sw_direct_flux_dn should have the correct values (hopefully). We don't use it right now but the land may want to access it at some point. We just have it explicitly used for |
Where is this set/updated? There's no other reference to it besides that function |
If I understand the interface correctly, here we are setting |
I believe, based on our previous discussion, only the value of |
This is what I see julia> simulation.integrator.p.radiation.rrtmgp_model.face_sw_direct_flux_dn
11×3456 view(::Matrix{Float32}, 1:11, :) with eltype Float32:
NaN NaN NaN NaN NaN NaN NaN NaN NaN … NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN … NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN NaN
NaN NaN NaN NaN NaN NaN NaN NaN NaN … NaN NaN NaN NaN NaN NaN NaN NaN For a |
I think flux_dn_dir is allocated in FluxSW struct but never gets updated in RRTMGP except for the first level here, and that's maybe why it's all NaNs in atmos. But I thought the first level would have correct values? |
The value at the first level is set here: https://github.com/CliMA/RRTMGP.jl/blob/main/src/rte/shortwave2stream.jl#L233 for the two stream shortwave solver! |
I found the issue and fixed in RRTMGP: CliMA/RRTMGP.jl#550 Closing this |
face_sw_direct_flux_dn
is used only inAllSkyRadiationWithClearSkyDiagnostics
in this block:It is not used by other modes, so I don't add it