Conversation
- eCLM manages ParFlow's porosity - Send watsat - vol_ice to ParFlow as ECLM_EFFPOROSITY - Treat water in ParFlow water as liquid; subtract ice formed this time step, which ParFlow applies one coupling interval later - Average porosity per gridcell over hydrologically active columns only; set not coupled cells to -9999
- unify subroutine naming scheme
- Keep both new OASIS fields: ECLM_EFFPOROSITY and ECLM_ICE_IMPEDANCE
- Move ice impedance c2g into the COUP_OAS_PFL block of lnd2atm
- Drop qflx_parflow adjusting nans (removed in #132)
- Keep soilhydrology_inst in lnd2atm under precompiler instead of passing it unconditionally
…orosity - Ice impedance is computed in ParFlow based on ECLM_EFFPOROSITY - Remove ECLM_ICE_IMPEDANCE OASIS field - Use local imped in soilwater_parflow as before
| h2osoi_ice(c,j) = min(h2osoi_ice(c,j), watsat(c,j)*dz(c,j)*denice) | ||
| h2osoi_liq(c,j) = max(0._r8, pfl_h2osoi_liq(c,j) & | ||
| - (h2osoi_ice(c,j) - h2osoi_ice_prev(c,j))) | ||
| pfl_eff_porosity(c,j) = watsat(c,j) - h2osoi_ice(c,j)/(dz(c,j)*denice) |
There was a problem hiding this comment.
Why is the effective porosity based on eCLM's porosity/watsat? Shouldn't this be computed in Parflow instead? Parflow is the one solving groundwater flow, thus it makes more sense to me to favor its porosity definition than eCLM.
The deeper question is, how to define porosity in the context of eCLM-Parflow? Should each model define their own porosities, or should both models share exactly the same? If porosity has to be the same, do we base it from eCLM or from Parflow? Answers to these would influence how effective porosity should be implemented.
There was a problem hiding this comment.
ParFlow can not compute the effective porosity by itself as it has no ice phase and no soil temperature, so θ_ice only lives in eCLM (PhaseChange). The open question is whether it's φ_eff or θ_ice that crosses the coupler.
With regard to 'watsat' specifically, this PR does not introduce eCLM's porosity into ParFlow; it simply makes an existing dependency explicit. In the up-to-date setup, ParFlow's input porosity is already eCLM's watsat.
My original design involved passing θ_ice and letting ParFlow subtract it from its own porosity, which has real advantages: no guard value is needed, potential remap error acts on a quantity that is zero most of the year and ice-free runs are bit-identical.
My opinion was changed by the fact that the liquid that is received is interpreted by eCLM against 'watsat' regardless. Allowing ParFlow to keep a different total does not isolate the models; it moves the inconsistency to where nothing can check it. The eCLM-side ice cap also guarantees that the effective porosity is in the range. Subtracting ice from a foreign porosity loses this guarantee, and a cell that eCLM considers to be completely full can end up below ParFlow's floor. This causes the freeze term to become unsatisfiable.
So, in answer to the deeper question, I would say that there should be one porosity, with eCLM owns over the coupled depth / grid points. This is not because eCLM has a stronger claim, but because it is the porosity that the rest of the coupled system is already interpreted against.
There was a problem hiding this comment.
My opinion was changed by the fact that the liquid that is received is interpreted by eCLM against 'watsat' regardless.
Makes sense. I also initially thought that θ_ice should be coupled, but this is a good argument in favor of φ_eff
I would say that there should be one porosity, with eCLM owns over the coupled depth / grid points.
Wouldn't favoring eCLM porosity compromise how Parflow computes relative saturation? I thought Parflow already assumes a Van-Genuchten parameterization for its porosity.
I've been noticing these walls of AI text in the past months and I fail to see what value it adds to the discussion. I just don't see any signal from overly verbose AI writing. It would be more acceptable if a user would thoroughly review the AI suggestions and then write his/her own interpretation containing only the relevant infomation at hand. This guy echoes my sentiment (emphasis mine):
I sincerely hope we keep our standards of written communication high and not devolve into low-effort AI spam that has been plaguing other open source repos. This matters to me since I take reading and writing seriously, despite of my average skill in English writing. Again from the same guy:
|
|
I wrote the summary above the label; everything below it is a draft that I reviewed and gave structure but barely rewrote. The labeling was intended to be honest about how it was produced, but a label does not make a long text worth reading. Regarding the longer reports themselves: I was asked to provide a more detailed report than before, which is one of the reasons why the description has grown so long. My own preference is closer to yours. The code speaks for itself, and I would be fine with that. Beyond that, I would say this discussion belongs in an internal thread rather than here. It is about our general writing style and not about this PR specifically, and I would like to keep the review on the coupling. |
|
Thanks for the clarification @s-poll. My meat-brain has been trained on your personal write-ups these past years and I know it's high signal :)
Exactly 🫱🏼🫲🏿 |
Summary
Until now ParFlow had no ice phase. eCLM received ParFlow's water as total water, then split it into ice and liquid. Frozen pore space therefore never reached ParFlow's flow calculation: frozen soil stored and conducted water in ParFlow as if it were unfrozen.
With this PR, ParFlow carries liquid water only, and eCLM owns the phase change. eCLM sends ParFlow a time-varying effective porosity
φ_eff = watsat − θ_icethrough a new OASIS field,ECLM_EFFPOROSITY.ParFlow uses it for two processes:
No separate impedance field is exchanged, which saves compute and memory, but it needs to be made sure that eCLM porosity matches the ParFlow's.
Companion ParFlow branch: HPSCTerrSys/parflow
dev-frozen-soil-coupling. Both branches must be used together, as well as adding a ECLM_EFFPOROSITY | PFL_EFFPOROSITY block in oasis namelist.This branch merged the existing branch for ice impedance (
dev-soil-ice), but removed most of the code changes while keeping the idea of using the ice impedance (see details in Change 3).@skollet : Your opinion on this PR would be very appreciated, as also ParFlow dynamics is strongly effected by this change.
Text below was drafted by AI:
Change 1: ParFlow water is liquid only (
soilwater_parflow)h2osoi_liq = pfl_h2osoi_liq − (h2osoi_ice − h2osoi_ice_prev), andh2osoi_iceis no longer reset from ParFlow's water.h2osoi_ice_previs a snapshot taken inclm_drv_init, beforePhaseChange(newWaterStateType%h2osoi_ice_prev_col).h2osoi_ice = min(h2osoi_ice, watsat·dz·denice).PhaseChangebounds ice only by the available water mass, and ParFlow can deliver more thanwatsat·dz.φ_effgoes negative and the freeze term in ParFlow cannot be satisfied.φ_eff, and that change must stay exact.pfl_eff_porosity_col = watsat − h2osoi_ice/(dz·denice)over1..nlevgrnd, sent unfloored. ParFlow applies the 0.01 floor itself, because it needs the raw values for the mass term.Change 2: New OASIS field
ECLM_EFFPOROSITY(lnd2atm,oasis3)c2g: porosity doesn't scale with area fraction.-9999, which ParFlow treats as uncoupled. A sentinel of 0 is not possible becauseφ_eff = 0is physical, and an early test with 0 switched off the freeze term where freezing was strongest.lnd2atmreceivessoilhydrology_inst/soilstate_instalso underCOUP_OAS_PFL(previouslyUSE_PDAFonly).EFF_POROSITY_TO_OASIS(inactive by default).oas_send/oas_receiverenamed tooas_send_parflow/oas_receive_parflow, following*_icon.Change 3: Ice impedance, compared with
dev-soil-icedev-soil-icesent the impedance as its own field,ECLM_ICE_IMPEDANCE. It was merged into this branch and then removed again.ice_impedance_grc/_col, thec2gand theICE_IMPEDANCEhistory field are gone, andsoilwater_parflowcomputesimpedlocally forhk_lonly, as on master.The impedance carries no information beyond
φ_eff:icefrac = θ_ice/watsat = 1 − φ_eff/watsat. ParFlow now computes it with eCLM's formula,10^(−e_ice·icefrac). The implementation differs fromdev-soil-icein these points:dev-soil-iceECLM_ICE_IMPEDANCE(the namcouple entry was never added)ECLM_EFFPOROSITY; the number of fields stays at 4FBzscales the face above. Interface 1/2 ended up on the land surface, the lowest interface got 1nbedrock)FBx/FBy/FBzc2gof the nonlinear impedance over all columns (lake/glacier columns with impedance 1 diluted it)e_iceSolver.ECLM.IceImpedanceFactor(default 6.0 =e_ice; 0 = off)The ice fraction is only correct if ParFlow's porosity input file equals exactly what eCLM sends without ice, after the same aggregation and the same OASIS remap. With
e_ice = 6, a 1 % porosity mismatch already reduces conductivity by 13 %. That's a requirement on the setup, not on this code (see Testing).Further change
SoilStateType: underCOUP_OAS_PFLthewatsathistory field is registered even withuse_cn = .false., so it can be written for diagnostics.Testing
Setup: EUR-12, restart 2018-01-01, 3-day simulatio, conservative remapping (CONSERV/FRACNNEI) and a porosity input file built from eCLM's aggregated watsat with the same weights.
n(φ_eff < 0) = 0throughout, ParFlow saturation ≤ 1. eCLM liquid matches ParFlow's liquid (|SOILLIQ − PFL_SOILLIQ| ≈ 1e-4, against ≈ 0.3 for the old total-water relation).φ_eff < watsat.dtreduction.Known limitations
H2OSOI > 1in frozen cells, mostly peat top layers, until the double-counted water drains. A one-time correction for such restarts is planned; a spinup under the new scheme avoids it.PhaseChange. Same property as the previousmin()clamp. It's invisible because the eCLM balance checks are compiled out underCOUP_OAS_PFL.φ_effisn't in the restart. Planned as a ParFlow restart field.