From 785febe3dfbae470be4057ef4a4d6442626314c1 Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 14:19:36 +1000 Subject: [PATCH 1/9] Rejig library config for AM3 --- CMakeLists.txt | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d432a5c..cef0539cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,19 +132,6 @@ if(CABLE_LIBRARY) src/science/soilsnow/cbl_surfbv.F90 src/science/soilsnow/cbl_thermal.F90 src/science/soilsnow/cbl_trimb.F90 - src/params/cable_phys_constants_mod.F90 - src/params/grid_constants_cbl.F90 - src/params/cable_photo_constants_mod.F90 - src/params/cable_other_constants_mod.F90 - src/params/cable_maths_constants_mod.F90 - src/util/cable_runtime_opts_mod.F90 - src/util/cable_common.F90 - src/coupled/shared/cable_canopy_type_mod.F90 - src/coupled/shared/cable_soilsnow_type_mod.F90 - src/coupled/shared/cable_soil_type_mod.F90 - src/coupled/shared/cable_veg_type_mod.F90 - src/util/cable_climate_type_mod.F90 - src/util/masks_cbl.F90 ) if(CABLE_LIBRARY_TARGET STREQUAL "access-esm1.6") @@ -156,6 +143,19 @@ if(CABLE_LIBRARY) src/coupled/esm/cable_pft_params_mod.F90 src/coupled/esm/casa_landuse.F90 src/coupled/esm/LAI_canopy_height_cbl.F90 + src/params/cable_phys_constants_mod.F90 + src/params/grid_constants_cbl.F90 + src/params/cable_photo_constants_mod.F90 + src/params/cable_other_constants_mod.F90 + src/params/cable_maths_constants_mod.F90 + src/util/cable_runtime_opts_mod.F90 + src/util/cable_common.F90 + src/coupled/shared/cable_canopy_type_mod.F90 + src/coupled/shared/cable_soilsnow_type_mod.F90 + src/coupled/shared/cable_soil_type_mod.F90 + src/coupled/shared/cable_veg_type_mod.F90 + src/util/cable_climate_type_mod.F90 + src/util/masks_cbl.F90 ) if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_compile_options(-r8 -i8) @@ -165,6 +165,14 @@ if(CABLE_LIBRARY) message(STATUS "Cannot compile library with unknown compiler") endif() + elseif(CABLE_LIBRARY_TARGET STREQUAL "access3") + if (CMAKE_Fortran_COMPILER_ID MATHCES "Intel") + add_compile_options(-r8 -i8) + elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") + add_compile_options(-fdefault-real-8 -fdefault-integer-8 -fdefault-double-8) + else() + message(STATUS "Cannot compile library with unknown compiler") + endif() else() message(STATUS "Specified library application does not exist") endif() From 5e0bd5a1ee77fb03571ba50d9f12d7659f25b9f1 Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 14:39:18 +1000 Subject: [PATCH 2/9] Add library manifests to CI --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4f9d92ae..3e1e9c130 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: spack-manifest-path: - .github/build-ci/manifests/gcc.spack.yaml.j2 - .github/build-ci/manifests/intel.spack.yaml.j2 + - .github/build-ci/manifests/library-gcc.spack.yaml.j2 + - .github/build-ci/manifests/library-intel.spack.yaml.j2 uses: access-nri/build-ci/.github/workflows/ci.yml@v3 with: # For defaults for args not specified here (eg. spack/packages/config refs), see https://github.com/ACCESS-NRI/build-ci/blob/v3/.github/workflows/README.md From 5ea70cd3ab9bc7099a56c8df991b9740ebddab5d Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 14:43:59 +1000 Subject: [PATCH 3/9] Add library manifests to CI --- .../manifests/library-gcc.spack.yaml.j2 | 17 +++++++++++++++++ .../manifests/library-intel.spack.yaml.j2 | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 .github/build-ci/manifests/library-gcc.spack.yaml.j2 create mode 100644 .github/build-ci/manifests/library-intel.spack.yaml.j2 diff --git a/.github/build-ci/manifests/library-gcc.spack.yaml.j2 b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 new file mode 100644 index 000000000..272eeb171 --- /dev/null +++ b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 @@ -0,0 +1,17 @@ +spack: + specs: + # package is defined in the workflows inputs.spack-manifest-data-pairs + # gcc_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi library=access3' + - '{{ package }} ~mpi library=access3' + packages: + gcc: + require: + - '{{ gcc_compiler_ver }}' + all: + require: + - '%access_gcc' + - 'target={{ target }}' + concretizer: + unify: false + view: false diff --git a/.github/build-ci/manifests/library-intel.spack.yaml.j2 b/.github/build-ci/manifests/library-intel.spack.yaml.j2 new file mode 100644 index 000000000..dd2565bae --- /dev/null +++ b/.github/build-ci/manifests/library-intel.spack.yaml.j2 @@ -0,0 +1,17 @@ +spack: + specs: + # package is defined in the workflows inputs.spack-manifest-data-pairs + # intel_compiler_ver is defined in the standard_definitions.json data file + - '{{ package }} +mpi library=access3' + - '{{ package }} ~mpi library=access3' + packages: + intel-oneapi-compilers-classic: + require: + - '{{ intel_compiler_ver }}' + all: + require: + - '%access_intel' + - 'target={{ target }}' + concretizer: + unify: false + view: false From 1bdd9237172837b7a2561bb500b4af29bcb6b284 Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 14:46:35 +1000 Subject: [PATCH 4/9] Set ref for spack-packages --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e1e9c130..ab013d2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,6 +20,7 @@ jobs: spack-manifest-path: ${{ matrix.spack-manifest-path }} # We need to install the compilers manually here because the upstream image is too large to run on GitHub-hosted runners spack-compiler-manifest-path: .github/build-ci/compilers/spack.yaml + access-spack-packages-ref: 1d9acf45c39229ff4e90a9aa49922b1169305476 allow-ssh-into-spack-install: false spack-oci-buildcache-url: oci://ghcr.io/CABLE-LSM/build-ci-buildcache # https://github.com/orgs/CABLE-LSM/packages/container/package/build-ci-buildcache # Since CABLE-LSM can't access ACCESS-NRI's self-hosted runners, we use a GitHub-hosted version From 3cb40571e93abc82951919641c51d1bbdadc816d Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 15:37:31 +1000 Subject: [PATCH 5/9] Remove templates taken from spack-packages --- .github/build-ci/manifests/library-gcc.spack.yaml.j2 | 8 ++++---- .github/build-ci/manifests/library-intel.spack.yaml.j2 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/build-ci/manifests/library-gcc.spack.yaml.j2 b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 index 272eeb171..9195ff0ea 100644 --- a/.github/build-ci/manifests/library-gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 @@ -2,16 +2,16 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs # gcc_compiler_ver is defined in the standard_definitions.json data file - - '{{ package }} +mpi library=access3' - - '{{ package }} ~mpi library=access3' + - 'cable@git.{{ ref }} +mpi library=access3' + - 'cable@git.{{ ref }} ~mpi library=access3' packages: gcc: require: - - '{{ gcc_compiler_ver }}' + - '@13.2.0' all: require: - '%access_gcc' - - 'target={{ target }}' + - 'target=x86_64 concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/library-intel.spack.yaml.j2 b/.github/build-ci/manifests/library-intel.spack.yaml.j2 index dd2565bae..050fee6fa 100644 --- a/.github/build-ci/manifests/library-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/library-intel.spack.yaml.j2 @@ -2,16 +2,16 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs # intel_compiler_ver is defined in the standard_definitions.json data file - - '{{ package }} +mpi library=access3' - - '{{ package }} ~mpi library=access3' + - 'cable@git.{{ ref }} +mpi library=access3' + - 'cable@git.{{ ref }} ~mpi library=access3' packages: intel-oneapi-compilers-classic: require: - - '{{ intel_compiler_ver }}' + - '@2021.10.0' all: require: - '%access_intel' - - 'target={{ target }}' + - 'target=x86_64' concretizer: unify: false view: false From 329c3022682a5b8e7299f9898e2116d6fee062c7 Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 15:56:17 +1000 Subject: [PATCH 6/9] Fix quotes --- .github/build-ci/manifests/library-gcc.spack.yaml.j2 | 6 +++--- .github/build-ci/manifests/library-intel.spack.yaml.j2 | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/build-ci/manifests/library-gcc.spack.yaml.j2 b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 index 9195ff0ea..a6cda21ee 100644 --- a/.github/build-ci/manifests/library-gcc.spack.yaml.j2 +++ b/.github/build-ci/manifests/library-gcc.spack.yaml.j2 @@ -2,8 +2,8 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs # gcc_compiler_ver is defined in the standard_definitions.json data file - - 'cable@git.{{ ref }} +mpi library=access3' - - 'cable@git.{{ ref }} ~mpi library=access3' + - cable@git.{{ ref }} +mpi library=access3 + - cable@git.{{ ref }} ~mpi library=access3 packages: gcc: require: @@ -11,7 +11,7 @@ spack: all: require: - '%access_gcc' - - 'target=x86_64 + - target=x86_64 concretizer: unify: false view: false diff --git a/.github/build-ci/manifests/library-intel.spack.yaml.j2 b/.github/build-ci/manifests/library-intel.spack.yaml.j2 index 050fee6fa..b9c351dca 100644 --- a/.github/build-ci/manifests/library-intel.spack.yaml.j2 +++ b/.github/build-ci/manifests/library-intel.spack.yaml.j2 @@ -2,8 +2,8 @@ spack: specs: # package is defined in the workflows inputs.spack-manifest-data-pairs # intel_compiler_ver is defined in the standard_definitions.json data file - - 'cable@git.{{ ref }} +mpi library=access3' - - 'cable@git.{{ ref }} ~mpi library=access3' + - cable@git.{{ ref }} +mpi library=access3 + - cable@git.{{ ref }} ~mpi library=access3 packages: intel-oneapi-compilers-classic: require: @@ -11,7 +11,7 @@ spack: all: require: - '%access_intel' - - 'target=x86_64' + - target=x86_64 concretizer: unify: false view: false From 4a692ca75d04742a2957d3cf8cf5ddae96292a68 Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 17:04:32 +1000 Subject: [PATCH 7/9] Misspelled matches --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cef0539cd..b25ce8c25 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,7 +166,7 @@ if(CABLE_LIBRARY) endif() elseif(CABLE_LIBRARY_TARGET STREQUAL "access3") - if (CMAKE_Fortran_COMPILER_ID MATHCES "Intel") + if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_compile_options(-r8 -i8) elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU") add_compile_options(-fdefault-real-8 -fdefault-integer-8 -fdefault-double-8) From 395b1fafa67227d67a1054735688883bbba7a07d Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 17:26:26 +1000 Subject: [PATCH 8/9] Move some files to common library --- CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b25ce8c25..1a34c7d6b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,6 +132,15 @@ if(CABLE_LIBRARY) src/science/soilsnow/cbl_surfbv.F90 src/science/soilsnow/cbl_thermal.F90 src/science/soilsnow/cbl_trimb.F90 + src/params/cable_phys_constants_mod.F90 + src/params/grid_constants_cbl.F90 + src/params/cable_photo_constants_mod.F90 + src/params/cable_other_constants_mod.F90 + src/params/cable_maths_constants_mod.F90 + src/util/cable_runtime_opts_mod.F90 + src/util/cable_common.F90 + src/util/cable_climate_type_mod.F90 + src/util/masks_cbl.F90 ) if(CABLE_LIBRARY_TARGET STREQUAL "access-esm1.6") @@ -143,19 +152,10 @@ if(CABLE_LIBRARY) src/coupled/esm/cable_pft_params_mod.F90 src/coupled/esm/casa_landuse.F90 src/coupled/esm/LAI_canopy_height_cbl.F90 - src/params/cable_phys_constants_mod.F90 - src/params/grid_constants_cbl.F90 - src/params/cable_photo_constants_mod.F90 - src/params/cable_other_constants_mod.F90 - src/params/cable_maths_constants_mod.F90 - src/util/cable_runtime_opts_mod.F90 - src/util/cable_common.F90 src/coupled/shared/cable_canopy_type_mod.F90 src/coupled/shared/cable_soilsnow_type_mod.F90 src/coupled/shared/cable_soil_type_mod.F90 src/coupled/shared/cable_veg_type_mod.F90 - src/util/cable_climate_type_mod.F90 - src/util/masks_cbl.F90 ) if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_compile_options(-r8 -i8) From d03381096fea49c406d4dbac2f2f6c6e65ca122f Mon Sep 17 00:00:00 2001 From: Lachlan Whyborn Date: Fri, 22 May 2026 17:43:21 +1000 Subject: [PATCH 9/9] Add type files to library --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a34c7d6b..14bf3c78d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,6 +166,23 @@ if(CABLE_LIBRARY) endif() elseif(CABLE_LIBRARY_TARGET STREQUAL "access3") + list(APPEND SOURCES + src/coupled/AM3/control/CM3/air_type.F90 + src/coupled/AM3/control/CM3/balances_type.F90 + src/coupled/AM3/control/CM3/bgc_pool_type.F90 + src/coupled/AM3/control/CM3/cable_define_types.F90 + src/coupled/AM3/control/CM3/cbl_canopy_type.F90 + src/coupled/AM3/control/CM3/cable_cbm_mod.F90 + src/coupled/AM3/control/CM3/climate_type.F90 + src/coupled/AM3/control/CM3/met_type_cbl.F90 + src/coupled/AM3/control/CM3/radiation_type.F90 + src/coupled/AM3/control/CM3/read_cable_namelists_mod.F90 + src/coupled/AM3/control/CM3/roughness_type.F90 + src/coupled/AM3/control/CM3/soil_type_cbl.F90 + src/coupled/AM3/control/CM3/ssnow_type.F90 + src/coupled/AM3/control/CM3/sum_flux_type.F90 + src/coupled/AM3/control/CM3/veg_type.F90 + ) if (CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_compile_options(-r8 -i8) elseif(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")