Skip to content

Conversation

oalcabes
Copy link
Member

This diagnostic calculates a resolution invariant cloud top height. It is sensitive to three parameters that have been added to ClimaParams -- "cloud_top_threshold," "cloud_top_k," and "cloud_top_a." Results are sensitive to parameter choices. I hand tuned to get somewhat decent default parameters with these results:
Screenshot 2025-09-18 at 9 52 14 AM

@oalcabes oalcabes force-pushed the oa/cltz_diag branch 5 times, most recently from 5b0819b to afbf27f Compare September 18, 2025 22:33
Copy link
Member

@tapios tapios left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!


ct_constants = CAP.microphysics_cloud_params(cache.params).ct_constants

q_cond = @. lazy(clw + cli)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
q_cond = @. lazy(clw + cli)
# Condensate density (kg/m^3)
q_cond = @. lazy(state.c.ρ * (q_liq + q_ice))

Copy link
Member Author

Choose a reason for hiding this comment

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

@tapios why do you want this to be per volume? (Doing it this way would require changing the threshold and k constants to also be per volume, which I wasn't initially doing)

Copy link
Member

Choose a reason for hiding this comment

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

It's the same you had before, isn't it? There were two multiplications by density in l. 1133/1134 before, and I replaced by the one multiplication here. I was wondering why it was there but thought you had reasons for it. It does make more sense to me to have the thresholds be on specific humidity (i.e., by mass).

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops you're right! I'll just remove it.

@oalcabes oalcabes force-pushed the oa/cltz_diag branch 4 times, most recently from 05d339b to 28fbf53 Compare September 19, 2025 17:14
ct_constants = CAP.microphysics_cloud_params(cache.params).ct_constants

# Condensate density (kg/m^3)
q_cond = @. lazy(state.c.ρ * (q_liq + q_ice))
Copy link
Member

Choose a reason for hiding this comment

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

It's better to show densities (per volume) with something else maybe L or ρq

# 2. Create a numerically stabilized exponential weight to favor higher altitudes
az = @. lazy(ct_constants.a * z)
max_az = maximum(az) # This prevents overflow in the exp() call
exp_az_stabilized = @. lazy(exp(az - max_az))
Copy link
Member

@sajjadazimi sajjadazimi Sep 23, 2025

Choose a reason for hiding this comment

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

The parameter a is dimensional (1/m) unless the variable exp_az_stabilized is given by exp(a(z/zmax - 1))

q_cond = @. lazy(state.c.ρ * (q_liq + q_ice))

# 1. Create the "cloudiness" mask using the sigmoid function
w = @. lazy(1 / (1 + exp(-(state.c.ρ * ct_constants.k) * (q_cond - (state.state.c.ρ * ct_constants.thresh)))))
Copy link
Member

Choose a reason for hiding this comment

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

You can also try multiplying the mask by condensate mass signal itself to get rid of noise.

Copy link
Member

Choose a reason for hiding this comment

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

Also, here k is dimensional (m^6) too.

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.

3 participants