Feature/modify physics - #561
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The updated ocean surface-flux path and the new MP/CP diagnostic accumulation contain confirmed correctness/robustness issues (array shape mismatch and unguarded OpenACC present usage) that can cause build failures or invalid results.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR updates the atmosphere–ocean surface-flux and physics coupling paths, and significantly revises the cumulus moist convective adjustment (MCA) implementation to better handle “no energy root” cases under available-water constraints (Issue #562).
Changes:
- Add ocean water-vapor surface flux (QV) to ocean variables and coupler exchange, and thread it through surface-flux calculations.
- Extend atmospheric diagnostics/surface handling to include precipitation flux contributions from both microphysics (MP) and cumulus parameterization (CP).
- Refactor MCA (moist convective adjustment) root-solving to incorporate water-feasibility constraints and more robust fallback/expansion logic.
File summaries
| File | Description |
|---|---|
| model/atm_nonhydro3d/src/ocean/mod_ocean_vars.F90 | Adds QV surface-flux ID and increments ocean surface-flux count. |
| model/atm_nonhydro3d/src/ocean/mod_ocean_mesh_gm.F90 | Disables vertical-coordinate setup in global ocean mesh init (matching RM). |
| model/atm_nonhydro3d/src/ocean/mod_ocean_component.F90 | Threads QV surface flux, adds vector conversions for cubed-sphere, revises surface heat-flux calculation. |
| model/atm_nonhydro3d/src/coupler/mod_cpl_vars.F90 | Adds QV to coupler OCN var set and exchange routines; fixes some typing/indexing. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_vars.F90 | Adds CP auxiliary-manager pointer and combines MP+CP precip diagnostic outputs. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_phy_sfc.F90 | Fixes vector conversion slicing and updates surface-flux argument extents to NeA. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_phy_cp_vars.F90 | Exposes CP surface-flux getters for precipitation/energy diagnostics. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_phy_bl.F90 | Renames tracer-list variable usage in BL tendency routine. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_phy_bl_vars.F90 | Adjusts BL tracer tendency variable naming. |
| model/atm_nonhydro3d/src/atmos/mod_atmos_component.F90 | Registers CP manager and sums MP+CP surface precipitation fluxes; adds QV to surface exchange. |
| FElib/src/radiation/scale_atm_phy_rd_dgm_simple.F90 | Initializes dtau_sw_kadd before loop to avoid stale values. |
| FElib/src/cumulus/scale_atm_phy_cp_dgm_mconv_adjustment.F90 | Major MCA redesign: water-feasible bracketing and improved handling of missing energy roots. |
| FElib/src/bl_turbulence/scale_atm_phy_bl_dgm_mynn_lv2.F90 | Fixes missing OpenMP private variable list entry. |
| FElib/src/bl_turbulence/scale_atm_phy_bl_dgm_common.F90 | Renames/clarifies tracer list handling and density conversions in BL common solver. |
Review details
Suppressed comments (1)
model/atm_nonhydro3d/src/atmos/mod_atmos_vars.F90:1047
- Same issue as RAIN: the OpenACC
present(SFLX_snow_MP%val, var_out)clause is unconditional, butSFLX_snow_MPis only associated whensw_MPis true. This can dereference an unassociated pointer or fail the OpenACC present check when MP is not active.
!$omp parallel
!$acc parallel present(SFLX_snow_MP%val, var_out) async(1)
!$omp do
- Files reviewed: 14/14 changed files
- Comments generated: 4
- Review effort level: Lite
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
close #562