Releases: Nicholaswogan/clima
clima v0.7.4
This release includes targeted RCE/RT robustness improvements since v0.7.3.
Highlights
- Added two ghost radiative-transfer layers when
double_radiative_grid=Trueto improve numerical stability near the top of atmosphere. - Added tunable IR thin-layer guard parameter
ir_tau_mintoRadtran, including Python/Fortran wrapper exposure. - Minor optimization in convective adjustment path during RCE updates.
- Updated default RCE mode behavior to require mode 2 by default before proceeding.
Detailed changes
-
Adiabat / RCE
double_radiative_gridpath now usesnz_r = 2*nz + 2(two ghost RT layers).- Radiative-grid copy path now fills ghost layers from top-layer properties.
- Added/updated inline docs for doubled-grid behavior in Fortran and Python.
- Convective adjustment code path includes a small efficiency cleanup.
-
Radtran
- New
Radtranproperty:ir_tau_min(default retained from code) for IR two-stream thin-layer handling. - Plumbed through
Radtran -> radiate -> two_stream_ir. - Exposed in wrappers:
- Fortran wrapper getter/setter
- Cython declarations
- Python property
rad.ir_tau_min
- New
-
Tests
test_adiabatinitial guess update.
Notes
- Main focus of this release is upper-atmosphere numerical stability and configurability of IR thin-layer behavior.
- No major public API restructuring; additions are backward-compatible.
Full Changelog: v0.7.3...v0.7.4
clima v0.7.3
Changes since v0.7.2
Highlights
- Refined
AdiabatClimateRCE stage-control flow with explicit mode progression logic. - Added optional
require_mode2control (exposed to Python) to force a mode-2 pass after mode-1 convergence before optional mode-3 polishing. - Reduced redundant nonlinear solves in RCE by skipping solve calls when only mode transitions are required (
perform_solveflow). - Improved RCE iteration logging to print iteration + mode each loop.
Adiabat / RCE
- Reworked outer-loop mode transition handling in
src/adiabat/clima_adiabat_solve.f90. - Added and documented
require_mode2inAdiabatClimate(src/adiabat/clima_adiabat.f90). - Added C/Fortran/Cython wrappers for
require_mode2:clima/fortran/AdiabatClimate.f90clima/cython/AdiabatClimate_pxd.pxdclima/cython/AdiabatClimate.pyx
make_column consistency
- Removed standalone
make_columnfromclima_adiabat_generaland unified behavior throughAdiabatClimate_make_column, which now routes throughself%make_profile(...)so altitude/column handling is consistent with the unified altitude scheme.
Documentation / API notes
- Clarified that
N_surfaceandN_oceanare strictly consistent whenreference_pressure <= 0(i.e. whenplanet_radiusis defined atP_surf).
Compatibility notes
- Existing scripts should remain compatible; new
require_mode2option is additive. - RCE loop internals changed, so iteration-by-iteration logs may differ slightly even when final converged states are unchanged.
Full Changelog: v0.7.2...v0.7.3
clima v0.7.2
Highlights
- Added a unified altitude recomputation path in
AdiabatClimateviacompute_altitude, and now use it consistently after profile construction and in RCE objective updates. - Added support for defining
planet_radiusat a configurablereference_pressure(dynes/cm²).reference_pressure <= 0: legacy behavior (planet_radiusat surface pressure).reference_pressure > 0: altitude/gravity are anchored to the specified reference pressure (with domain validation).
- Added stored gravity diagnostics on the climate grid:
gravity_surf(surface gravity)gravity(:)(layer-center gravity)
- Added
NASA9heat-capacity evaluation support (heat_capacity_nasa9) in thermodynamic utilities.
API additions
- New
AdiabatClimateproperty:reference_pressure
- New read-only
AdiabatClimateoutputs:gravity_surfgravity
- These are exposed through Fortran wrappers and Python/Cython bindings.
Internal improvements
- Added a reusable dense-output ODE helper in
clima_useful:solve_ivp_dop853
- Introduced
src/adiabat/clima_adiabat_altitude.f90submodule to isolate altitude integration logic. - Simplified ownership of altitude state by setting
self%z/self%dzin the unified altitude routine.
Behavioral notes
- Default integration tolerance
rtolhas been relaxed from1e-12to1e-9for better robustness/performance balance. - Existing behavior is preserved when
reference_pressureis left at default (-1.0).
Validation
- Updated test coverage to exercise the positive
reference_pressurecode path. - Valgrind runs reported no memory issues for tested paths.
Full Changelog: v0.7.1...v0.7.2
clima v0.7.1
This release improves radiative transfer performance for doubled radiative-grid workflows and adds more robust CIA pair-name parsing for ion species.
Highlights
- Faster opacity computation for doubled RT grids.
- Support for CIA filenames/species pairs that include hyphens (e.g. ion pairs like
H--e-). - More robust CIA pair parsing with clear error handling for invalid or ambiguous species splits.
What Changed
Performance: paired-layer caching in RT opacity path
- Added a paired-layer reuse mask in
OpticalPropertiesWorkfor doubled-grid cases. - Reused interpolation results between adjacent duplicated layers when state matches:
- k-coeff interpolation
- CIA interpolation
- photolysis interpolation
- water continuum interpolation
- particle interpolation
- Reused RORR sort/rebin output for paired duplicated layers.
- This reduces redundant interpolation/rebin work and improves overall RCE runtime in doubled-grid configurations.
CIA parsing improvements
- Replaced simple split-on-first-
-behavior with robust CIA pair parsing logic. - Correctly handles species names containing hyphens.
- Added explicit errors when a CIA pair cannot be parsed or is ambiguous.
Files Updated
src/radtran/clima_radtran_types.f90src/radtran/clima_radtran_types_create.f90CMakeLists.txt(version bump to0.7.1)
Notes
- No public API changes are required for existing workflows.
- Behavior is backward compatible; new parsing is stricter only for malformed/ambiguous CIA pair strings.
Full Changelog: v0.7.0...v0.7.1
clima v0.7.0
Clima v0.7.0
Highlights
This release introduces a new pseudo-transient continuation (PTC) nonlinear solver path for radiative-convective equilibrium (RCE), adds configurable solver strategies, improves solver diagnostics and robustness, and adds a gas-giant (no hard-surface) lower thermal boundary option in radiative transfer.
Added
- New
PTCSolvermodule (src/clima_ptc.f90)- Adaptive pseudo-time stepping
- Dense and banded Jacobian support
- Step rejection / retry handling
- Optional custom timestep, convergence, and verification callbacks
- Progress callback support
- Stagnation detection and explicit divergence reason codes
- New RCE solve strategies in
AdiabatClimateHYBRJ_ONLYPTC_THEN_HYBRJHYBRJ_THEN_PTC_THEN_HYBRJ
- New public controls exposed through wrappers:
AdiabatClimate.rce_solve_strategyAdiabatClimate.dt_increment
- Radiative transfer lower-boundary switch for thermal IR:
Radtran.has_hard_surfaceTrue(default): hard-surface thermal BCFalse: gas-giant/no-hard-surface thermal BC (PICASO-style diffusion BC)
Changed
- RCE nonlinear solve flow in
src/adiabat/clima_adiabat_solve.f90was refactored:- Helper-based solver execution (
run_hybrj,run_ptc) - Cleaner solve-strategy orchestration
- Reduced duplicate residual/Jacobian work via caching in solver callbacks
- Improved convergence metric reporting (
max|F|,max|F/F0|)
- Helper-based solver execution (
- Convective-zone update logic was revised for better stability:
- Clear staged behavior for convection-mask updates during RCE iterations
- Improved handling of
prevent_overconvectionpolishing/backoff behavior - Oscillation/stagnation guard behavior tightened to reduce mask flip-flop edge cases
- PTC progress reporting moved to dedicated callback machinery for cleaner output behavior.
- Additional guardrails:
- Immediate return when
max_rc_iters < 1 - Input validation for timestep growth controls
- Immediate return when
Python / Fortran API updates
clima/cython/AdiabatClimate.pyx- Added properties:
dt_increment,rce_solve_strategy
- Added properties:
clima/fortran/AdiabatClimate.f90- Added corresponding C bindings for the new properties
clima/cython/Radtran.pyx- Added property:
has_hard_surface
- Added property:
clima/fortran/Radtran.f90- Added corresponding C bindings for
has_hard_surface
- Added corresponding C bindings for
Radiative Transfer
- Thermal RT now supports gas-giant lower BC mode via
has_hard_surface = False:- Implemented in
two_stream_irand threaded throughradiateandRadtrancall chain.
- Implemented in
- Solar RT behavior is unchanged; for no-surface planets, use near-zero surface albedo as appropriate for your setup.
Testing
- Updated
tests/test_adiabat.f90coverage for new solve-path behavior.
Notes
- Default behavior remains backward-compatible for existing models:
- Hard-surface thermal BC remains default (
has_hard_surface = True). - Existing HYBRJ workflows are still available.
- Hard-surface thermal BC remains default (
Full Changelog: v0.6.0...v0.7.0
clima 0.6.0
Full Changelog: v0.5.15...v0.6.0
clima 0.5.15
Full Changelog: v0.5.14...v0.5.15
clima v0.5.14
Full Changelog: v0.5.13...v0.5.14
clima v0.5.13
Full Changelog: v0.5.12...v0.5.13
clima v0.5.12
Full Changelog: v0.5.11...v0.5.12