From 4dc77cde16cbfc75b9e8c55b99091c645cb54396 Mon Sep 17 00:00:00 2001 From: Julian Schmitt <43148195+Julians42@users.noreply.github.com> Date: Fri, 23 Aug 2024 11:09:24 -0700 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Zhaoyi Shen <11598433+szy21@users.noreply.github.com> Co-authored-by: Gabriele Bozzola --- src/diagnostics/core_diagnostics.jl | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/diagnostics/core_diagnostics.jl b/src/diagnostics/core_diagnostics.jl index f83c4b79971..54619994aa0 100644 --- a/src/diagnostics/core_diagnostics.jl +++ b/src/diagnostics/core_diagnostics.jl @@ -749,7 +749,6 @@ function compute_clwvi!( time, moisture_model::T, ) where {T <: Union{EquilMoistModel, NonEquilMoistModel}} - thermo_params = CAP.thermodynamics_params(cache.params) if isnothing(out) out = zeros(axes(Fields.level(state.f, half))) Operators.column_integral_definite!( @@ -798,7 +797,6 @@ function compute_lwp!( time, moisture_model::T, ) where {T <: Union{EquilMoistModel, NonEquilMoistModel}} - thermo_params = CAP.thermodynamics_params(cache.params) if isnothing(out) out = zeros(axes(Fields.level(state.f, half))) Operators.column_integral_definite!( @@ -841,7 +839,6 @@ function compute_clivi!( time, moisture_model::T, ) where {T <: Union{EquilMoistModel, NonEquilMoistModel}} - thermo_params = CAP.thermodynamics_params(cache.params) if isnothing(out) out = zeros(axes(Fields.level(state.f, half))) Operators.column_integral_definite!( @@ -878,8 +875,6 @@ function compute_dsevi!(out, state, cache, time) if isnothing(out) out = zeros(axes(Fields.level(state.f, half))) cp = CAP.cp_d(cache.params) - z = Fields.coordinate_field(state.c.ρ).z - g = CAP.grav(cache.params) dse = cache.scratch.ᶜtemp_scalar @. dse = state.c.ρ * ( @@ -890,8 +885,6 @@ function compute_dsevi!(out, state, cache, time) return out else cp = CAP.cp_d(cache.params) - z = Fields.coordinate_field(state.c.ρ).z - g = CAP.grav(cache.params) dse = cache.scratch.ᶜtemp_scalar @. dse = state.c.ρ * ( @@ -931,10 +924,11 @@ function compute_clvi!( out = zeros(axes(Fields.level(state.f, half))) cloud_cover = cache.scratch.ᶜtemp_scalar cloud_cover .= + FT = Spaces.undertype(axes(cloud_cover)) ifelse.( - cache.precomputed.cloud_diagnostics_tuple.cf .> 0.0f0, - 1.0f0, - 0.0f0, + cache.precomputed.cloud_diagnostics_tuple.cf .> zero(FT), + one(FT), + zero(FT), ) Operators.column_integral_definite!(out, cloud_cover) return out @@ -953,7 +947,6 @@ end add_diagnostic_variable!( short_name = "clvi", long_name = "Vertical Cloud Fraction Integral", - standard_name = "vertical_cloud_fraction_integral", units = "m", comments = """ The total height of the column occupied at least partially by cloud. @@ -963,7 +956,7 @@ add_diagnostic_variable!( ### -# Total Column Integrated Specific Humidity (2d) +# Column integrated total specific humidity (2d) ### compute_prw!(out, state, cache, time) = compute_prw!(out, state, cache, time, cache.atmos.moisture_model) @@ -1097,7 +1090,6 @@ end add_diagnostic_variable!( short_name = "husv", long_name = "Vapor Specific Humidity", - standard_name = "vapor_specific_humidity", units = "kg kg^-1", comments = "Mass of water vapor per mass of air", compute! = compute_husv!,