Skip to content
Success

Changes

Summary

  1. Fail bindiff on shape mismatches; optionally reject extra variables (#1370) (details)
  2. Adding Microhpysics to JAX (#1362) (details)
Commit d7b8c3fb8977ea0824c0b8f3aa52a5346c3c92d3 by noreply
Fail bindiff on shape mismatches; optionally reject extra variables (#1370)

* Add opt-in strict NetCDF structure checks to bindiff

* Fail bindiff comparisons on any shape mismatch

* Trim strict bindiff PR scope

* Clarify strict bindiff variable matching

* Making shape mismatches only a warning by default again - this is in case someone wants to change how metadata is stored in the netcdf. For example,  new parameter is added to clubb_params, now the netcdf storage for clubb_params is 1 element bigger and the python will detect the sizes are not comparable (shape error) - we don't want this to cause this bindiff script to fail.
The file was modifiedrun_scripts/run_bindiff_all.py (diff)
The file was modifiedrun_scripts/README.md (diff)
Commit 70c5581b0784cb1117c9a4c0acc1d39be5c9e15c by noreply
Adding Microhpysics to JAX (#1362)

* Enable JAX microphysics with Fortran-shaped interfaces

Connect KK and Morrison cores through microphysics initialization, PDF preparation, transport, sedimentation, statistics, and delayed feedback. Retain explicit guards and dummy interfaces for unsupported features.

Add DYCOMS2 RF02 DS to the JAX-versus-Fortran harness at 240 timesteps. The four-column CPU double comparison passes at the existing 1e-7 threshold. Morrison validation remains limited to synthetic interface checks.

* Add RICO and LBA KK microphysics comparisons

Configure per-case timestep limits, timesteps and namelist overrides in the
JAX-versus-Fortran harness. Add RICO at 380 steps of 60 seconds and the LBA
warm-rain KK variant for its full 360-step, six-hour duration.

Match Fortran multicolumn hydrometeor hole-filling grid metrics, keep lazy
KK module constants outside JAX tracing, resolve LBA radiation tables from
the configured forcing path, and use the source LBA surface-flux pi constant.
Update the existing surface-flux expectation and document coverage.

Validation: serial live comparisons pass for RICO 380, DYCOMS2 RF02 DS 240,
and LBA 360 at the unchanged 1e-7 thresholds with four columns and standard
statistics. All LBA prefixes and its comparison against release O2 pass.
Focused checks: 72 RICO/integration checks and 51 LBA/radiation checks pass.

* Replace draft JAX Morrison core with source-transcribed physics

Restore Morrison process assembly, sedimentation, corrections and diagnostics
with source float32 state and native arithmetic. Consolidate the implementation
in module_mp_graupel.py, align public routine boundaries with Fortran, and remove
unused draft helpers and their tests. Fix column snow integration and conversion
of accumulated fallout to precipitation rates.

Add the lba_morrison strict startup case (60 steps at the unchanged 1e-7 threshold)
and isolate named variants' output directories. Update support documentation.

Validation: fresh serial LBA Morrison strict comparison passes; 42 focused
physics/interface checks pass. A separate six-hour, eight-column replay matches
all 25 pre-cleanup NetCDF variables exactly. Active ice/graupel validation remains
outstanding. Experimental ensemble tooling and investigation files are excluded.

* Little script/readme cleanup

* Little fixes for morrison code and adding morrison cases to jax_vs_fortran test, but with a short number of iterations since morrison is hard to compare (mainly because it's in single precision and that seems to hugely amplify floating-point error to be larger than our correctness tolerance that our test uses).

* Batching KK parabolic cylinder calls - this results in far less memory consumed because it's a big function and was called hundreds of times each timestep, and that consumes lots of memory because the jit step inlines each of those calls. Batching them allows us to compute them all in pretty much the same place with far less inlining. Also improving the jax_vs_fortran scripts handling of multiple processes - now it exits out correctly when using ctrl-c

* Little fix to prevent divergence in some fields with kk microphysics.

* Simplify JAX comparison CLI and reporting

* Adding a test, run_jax_comparison_mutation_test.py, that injects little code errors into the jax and runs the jax_vs_fortran script to ensure it fails.

* Little formatting changes

* Improving comment

* Update to the json return option from the runbindiff - clearer explaination and more functionality, making other scripts make use of it too

* Improving readme a bit

* Improving the jax_vs_fortran failure test by adding a case that tests what happens when a stat value is output by one file but not the other
The file was modifiedclubb_jax/src/Benchmark_cases/lba.py (diff)
The file was modifiedclubb_jax/run_jax.py (diff)
The file was addedclubb_jax/src/Microphys/silhs_category_variance_module.py
The file was modifiedclubb_jax/src/Microphys/Morrison_microphys/module_mp_graupel.py (diff)
The file was modifiedclubb_jax/src/Microphys/gfdl_activation.py (diff)
The file was addedclubb_jax/src/Microphys/KK_microphys/covariance_dv.py
The file was modifiedclubb_jax/tests/test_kk_autoconversion.py (diff)
The file was modifiedclubb_jax/src/CLUBB_core/precipitation_fraction.py (diff)
The file was modifiedtests/README.md (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/PDF_integrals_means.py (diff)
The file was modifiedclubb_jax/src/Microphys/cloud_sed_module.py (diff)
The file was removedclubb_jax/src/Microphys/KK_microphys/kk_microphys_driver.py
The file was modifiedclubb_jax/tests/test_hydrometeor_mixed_moments.py (diff)
The file was modifiedclubb_jax/README.md (diff)
The file was modifiedjenkins_tests/clubb_jax_tests/Jenkinsfile (diff)
The file was modifiedclubb_jax/src/Benchmark_cases/prescribe_forcings.py (diff)
The file was modifiedclubb_jax/tests/test_kk_rico_oracle.py (diff)
The file was modifiedrun_scripts/README.md (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/KK_upscaled_covariances.py (diff)
The file was modifiedclubb_jax/src/Microphys/Morrison_microphys/__init__.py (diff)
The file was modifiedtests/run_jax_vs_fortran_cases.py (diff)
The file was removedclubb_jax/src/Microphys/morrison_microphys_step.py
The file was modifiedclubb_jax/tests/test_stats_output_time.py (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/KK_upscaled_turbulent_sed.py (diff)
The file was addedtests/run_jax_comparison_mutation_test.py
The file was addedclubb_jax/tests/test_microphysics_port_structure.py
The file was modifiedclubb_jax/src/Microphys/KK_microphys_module.py (diff)
The file was modifiedclubb_jax/src/Microphys/mixed_moment_PDF_integrals.py (diff)
The file was removedclubb_jax/tests/test_morrison_rates.py
The file was modifiedclubb_jax/src/Microphys/advance_microphys_module.py (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/parabolic_cylinder.py (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/KK_Nrm_tendencies.py (diff)
The file was removedclubb_jax/src/Microphys/kk_microphys_step.py
The file was modifiedclubb_jax/tests/test_ice_dfsn.py (diff)
The file was addedclubb_jax/tests/test_microphysics_error_paths.py
The file was addedclubb_jax/src/Microphys/microphys_init_cleanup.py
The file was modifiedclubb_jax/tests/test_forcing_port_structure.py (diff)
The file was modifiedclubb_jax/tests/test_differentiability.py (diff)
The file was modifiedclubb_jax/src/CLUBB_core/setup_clubb_pdf_params.py (diff)
The file was addedclubb_jax/tests/microphysics_test_inputs.py
The file was modifiedinput/flag_sets/README.md (diff)
The file was addedclubb_jax/src/Microphys/estimate_scm_microphys_module.py
The file was modifiedclubb_jax/tests/test_lba_sfclyr.py (diff)
The file was removedclubb_jax/tests/test_morrison_differentiable.py
The file was addedclubb_jax/src/Microphys/lh_microphys_driver_module.py
The file was modifiedclubb_jax/src/Radiation/parameters_radiation.py (diff)
The file was modifiedLLM_prompts/update_python_api_and_drivers.md (diff)
The file was modifiedtests/run_python_vs_fortran_cases.py (diff)
The file was addedtests/pytests/test_jax_compare_forwarding.py
The file was modifiedclubb_jax/tests/test_morrison_special.py (diff)
The file was modifiedclubb_jax/src/Microphys/morrison_microphys_module.py (diff)
The file was modifiedclubb_jax/tests/test_component_precip_frac_specify.py (diff)
The file was addedclubb_jax/src/Microphys/pdf_hydromet_microphys_wrapper.py
The file was modifiedclubb_jax/tests/test_unsupported_config_guards.py (diff)
The file was modifiedclubb_jax/src/Microphys/KK_microphys/KK_upscaled_means.py (diff)
The file was addedtests/pytests/test_bindiff_report.py
The file was modifiedclubb_jax/src/Microphys/KK_microphys/PDF_integrals_covar.py (diff)
The file was addedclubb_jax/tests/test_kk_covariance_batch.py
The file was modifiedclubb_jax/src/advance_clubb_to_end.py (diff)
The file was modifiedclubb_jax/src/CLUBB_core/stats_clubb_utilities.py (diff)
The file was addedclubb_jax/tests/test_microphysics_integration.py
The file was modifiedclubb_jax/src/Microphys/ice_dfsn_module.py (diff)
The file was modifiedclubb_jax/src/Microphys/microphys_driver.py (diff)
The file was addedclubb_jax/src/Microphys/parameters_microphys.py
The file was modifiedclubb_jax/tests/test_cloud_drop_sed.py (diff)
The file was modifiedclubb_jax/tests/test_jax_cli_options.py (diff)
The file was modifiedrun_scripts/run_bindiff_all.py (diff)
The file was modifiedclubb_jax/src/CLUBB_core/fill_holes.py (diff)
The file was addedclubb_jax/src/Microphys/coamps_microphys_driver_module.py
The file was modifiedclubb_jax/tests/test_gfdl_activation.py (diff)
The file was addedclubb_jax/src/Input_fields/corr_varnce_input_reader.py
The file was addedclubb_jax/tests/microphysics_coefficients.py
The file was addedclubb_jax/src/Benchmark_cases/clex9_oct14.py
The file was modifiedclubb_jax/src/Microphys/KK_microphys/parameters_KK.py (diff)
The file was modifiedclubb_jax/src/clubb_case_initalization.py (diff)