Skip to content

Releases: Nicholaswogan/clima

clima v0.7.4

28 Feb 00:51

Choose a tag to compare

This release includes targeted RCE/RT robustness improvements since v0.7.3.

Highlights

  • Added two ghost radiative-transfer layers when double_radiative_grid=True to improve numerical stability near the top of atmosphere.
  • Added tunable IR thin-layer guard parameter ir_tau_min to Radtran, 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_grid path now uses nz_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 Radtran property: 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
  • Tests

    • test_adiabat initial 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

21 Feb 20:33

Choose a tag to compare

Changes since v0.7.2

Highlights

  • Refined AdiabatClimate RCE stage-control flow with explicit mode progression logic.
  • Added optional require_mode2 control (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_solve flow).
  • 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_mode2 in AdiabatClimate (src/adiabat/clima_adiabat.f90).
  • Added C/Fortran/Cython wrappers for require_mode2:
    • clima/fortran/AdiabatClimate.f90
    • clima/cython/AdiabatClimate_pxd.pxd
    • clima/cython/AdiabatClimate.pyx

make_column consistency

  • Removed standalone make_column from clima_adiabat_general and unified behavior through AdiabatClimate_make_column, which now routes through self%make_profile(...) so altitude/column handling is consistent with the unified altitude scheme.

Documentation / API notes

  • Clarified that N_surface and N_ocean are strictly consistent when reference_pressure <= 0 (i.e. when planet_radius is defined at P_surf).

Compatibility notes

  • Existing scripts should remain compatible; new require_mode2 option 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

20 Feb 02:14

Choose a tag to compare

Highlights

  • Added a unified altitude recomputation path in AdiabatClimate via compute_altitude, and now use it consistently after profile construction and in RCE objective updates.
  • Added support for defining planet_radius at a configurable reference_pressure (dynes/cm²).
    • reference_pressure <= 0: legacy behavior (planet_radius at 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 NASA9 heat-capacity evaluation support (heat_capacity_nasa9) in thermodynamic utilities.

API additions

  • New AdiabatClimate property:
    • reference_pressure
  • New read-only AdiabatClimate outputs:
    • gravity_surf
    • gravity
  • 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.f90 submodule to isolate altitude integration logic.
  • Simplified ownership of altitude state by setting self%z/self%dz in the unified altitude routine.

Behavioral notes

  • Default integration tolerance rtol has been relaxed from 1e-12 to 1e-9 for better robustness/performance balance.
  • Existing behavior is preserved when reference_pressure is left at default (-1.0).

Validation

  • Updated test coverage to exercise the positive reference_pressure code path.
  • Valgrind runs reported no memory issues for tested paths.

Full Changelog: v0.7.1...v0.7.2

clima v0.7.1

18 Feb 18:40

Choose a tag to compare

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 OpticalPropertiesWork for 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.f90
  • src/radtran/clima_radtran_types_create.f90
  • CMakeLists.txt (version bump to 0.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

13 Feb 19:22

Choose a tag to compare

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 PTCSolver module (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 AdiabatClimate
    • HYBRJ_ONLY
    • PTC_THEN_HYBRJ
    • HYBRJ_THEN_PTC_THEN_HYBRJ
  • New public controls exposed through wrappers:
    • AdiabatClimate.rce_solve_strategy
    • AdiabatClimate.dt_increment
  • Radiative transfer lower-boundary switch for thermal IR:
    • Radtran.has_hard_surface
    • True (default): hard-surface thermal BC
    • False: gas-giant/no-hard-surface thermal BC (PICASO-style diffusion BC)

Changed

  • RCE nonlinear solve flow in src/adiabat/clima_adiabat_solve.f90 was 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|)
  • Convective-zone update logic was revised for better stability:
    • Clear staged behavior for convection-mask updates during RCE iterations
    • Improved handling of prevent_overconvection polishing/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

Python / Fortran API updates

  • clima/cython/AdiabatClimate.pyx
    • Added properties: dt_increment, rce_solve_strategy
  • clima/fortran/AdiabatClimate.f90
    • Added corresponding C bindings for the new properties
  • clima/cython/Radtran.pyx
    • Added property: has_hard_surface
  • clima/fortran/Radtran.f90
    • Added corresponding C bindings for has_hard_surface

Radiative Transfer

  • Thermal RT now supports gas-giant lower BC mode via has_hard_surface = False:
    • Implemented in two_stream_ir and threaded through radiate and Radtran call chain.
  • Solar RT behavior is unchanged; for no-surface planets, use near-zero surface albedo as appropriate for your setup.

Testing

  • Updated tests/test_adiabat.f90 coverage 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.

Full Changelog: v0.6.0...v0.7.0

clima 0.6.0

07 Feb 00:00

Choose a tag to compare

Full Changelog: v0.5.15...v0.6.0

clima 0.5.15

21 Jan 18:45

Choose a tag to compare

clima v0.5.14

21 Jan 18:40

Choose a tag to compare

clima v0.5.13

18 Nov 13:30

Choose a tag to compare

clima v0.5.12

15 Nov 23:23

Choose a tag to compare