Skip to content

add precipitation fraction - #4884

Closed
szy21 wants to merge 12 commits into
mainfrom
zs/ice
Closed

szy21 wants to merge 12 commits into
mainfrom
zs/ice

Conversation

@szy21

@szy21 szy21 commented Oct 10, 2026

Copy link
Copy Markdown
Member

Purpose

WIP. do not review yet

To-do

Content


  • I have read and checked the items on the review checklist.

szy21 and others added 12 commits October 9, 2026 20:48
…odes

sgs_ice_uniform_fraction_ramped(ξ_ice, T, T_lo, T_hi): ξ_ice at node
temperatures above T_hi, 1 (uniform) below T_lo, linear in between, so the
excess reconstruction can be used for mixed-phase ice while cirrus ice stays
uniform. Provisional parameters sgs_ice_uniform_ramp_T_low/high (defaults 0, 0
= ramp off, bitwise neutral); Microphysics1MEvaluator carries the two bounds
and keeps its 18-argument constructor.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
sgs_ice_incloud_fraction (provisional, default 0 = bitwise neutral): a fraction
β of the subdomain-mean cloud ice drawn on at each quadrature node is confined
to the ice-supersaturated nodes (colder than freezing, non-precipitating water
above ice saturation; SGSIceSupersaturatedFlag), whose quadrature weight cf_ice
microphysics_tendencies_1m computes with one extra saturation pass. The node
factor φ = (1−β) + β·flag/cf_ice (sgs_ice_incloud_factor) has quadrature mean 1,
so the cell ice is conserved; cf_ice = 0 falls back to uniform. Physical
reading: cloud ice sits in the cloudy part of the cell where the Bergeron
transfer from the coexisting liquid acts on it, instead of being spread into the
clear part where it sublimates. Microphysics1MEvaluator carries (β, cf_ice) and
keeps the 18- and 20-argument constructors.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…the nodes

sgs_precip_incloud_fraction (provisional, default 0 = bitwise neutral): a
fraction β_p of the cell-mean rain and snow seen at each quadrature node is
confined to the moist half of the PDF (nodes whose centred saturation excess
S′ ≥ 0; SGSMoistHalfFlag, weight cf_precip computed by
microphysics_tendencies_1m with one extra pass), with the node total water
shifted by the same amount so the node vapour and the condensate
reconstruction are unchanged. ⟨φ_p⟩ = 1 conserves the cell precipitation.
Physical reading: precipitation falls through the cloudy part of the cell and
the air beneath it, so below-cloud rain evaporation and snow sublimation see
that air's humidity rather than the driest tail of the PDF (the
precipitation-fraction treatment of IFS/CAM). Microphysics1MEvaluator carries
(β_precip, cf_precip); the 18-, 20- and 22-argument constructors are kept.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
snow_deposition_sublimation: "DepositionOnly" selects CloudMicrophysics'
DepositionOnly (snow deposition below freezing, no sublimation; attribution
option). Parameter test covers all three variants.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…cement

sgs_snow_incloud_fraction (provisional, default -1 = same as
sgs_precip_incloud_fraction, bitwise neutral for existing configs): the snow
seen at a quadrature node can be placed with its own fraction, so rain alone
can be confined to the moist half of the PDF while snow stays uniform (or the
reverse). Microphysics1MEvaluator carries β_snow; the 24-argument constructor
sets it equal to β_precip.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The sgs_ice_incloud_fraction option (confining the cell-mean cloud ice to the
ice-supersaturated quadrature nodes) is removed: offline screens and the
campaign showed it adds nothing once the Hallett-Mossop source and the ξ_ice
temperature ramp are present, and its concentrated node ice is autoconverted
by the ice-to-snow threshold. The generic node factor is kept for the
precipitation-fraction placement as sgs_placement_factor; the
Microphysics1MEvaluator constructors are now 18, 20, 22 and 23 arguments.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…cement

Diagnose the precipitation fraction a_p of each cell by maximum-random
overlap of the cloud cover swept from the top (`set_precip_fraction!`,
`ᶜprecip_frac`), reset where the environment carries no precipitation, and
confine the placed rain and snow to the moistest a_p of the sampled PDF:
the shaft threshold on the centred saturation excess is the closed-form
Gaussian quantile `S_star = σ_S Φ⁻¹(1 − a_p)` with a smooth node weight,
normalized by the discrete weight of the selected nodes so the cell-mean
precipitation is conserved exactly. The discrete cloudy mass CF_d of the
quadrature is stored with the SGS moments. Enabled by a non-negative
`sgs_precip_overlap_decay` (default -1 keeps the moist-half placement
unchanged).

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Under the overlap precipitation fraction, `sgs_precip_shaft_random` places
the shaft on every cloudy node plus a random share
p = (a_p − CF_d)/(1 − CF_d) of the clear nodes at the in-shaft
concentration q/A, A = CF_d + (1 − CF_d) p, so rain evaporation and snow
sublimation are evaluated at the clear-sky humidity of the cell rather
than at its moist tail. Each node's tendency is the mixture of the
in-shaft and precipitation-free states with the same node vapour; the
cell-mean precipitation is conserved exactly with the cloudy weight that
accumulates CF_d. Default off.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ction

`sgs_precip_fraction_floor` (default 0.1, the previous hard-coded value)
sets the smallest precipitation fraction the node placement uses.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
The tendency broadcast had grown past ~30 arguments, which drops Julia's
broadcast off its specialized getindex path and allocates inside the GPU
kernel (InvalidIRError: gpu_gc_pool_alloc). `sgs_microphysics_options`
packs α, the uniform fractions, the ice ramp and the precipitation-placement
keys into a NamedTuple consumed by a forwarding method of
`microphysics_tendencies_1m`; the positional form is unchanged.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A NamedTuple is not a valid broadcast argument; `SGSMicrophysicsOptions`
carries the same fields and broadcasts as a scalar.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ysics splintering branch; building on CM main)

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@szy21 szy21 closed this Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview for this PR: https://clima.github.io/ClimaAtmos.jl/previews/PR4884/

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.

1 participant