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..a6cda21ee --- /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 + - cable@git.{{ ref }} +mpi library=access3 + - cable@git.{{ ref }} ~mpi library=access3 + packages: + gcc: + require: + - '@13.2.0' + all: + require: + - '%access_gcc' + - 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 new file mode 100644 index 000000000..b9c351dca --- /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 + - cable@git.{{ ref }} +mpi library=access3 + - cable@git.{{ ref }} ~mpi library=access3 + packages: + intel-oneapi-compilers-classic: + require: + - '@2021.10.0' + all: + require: + - '%access_intel' + - target=x86_64 + concretizer: + unify: false + view: false diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d4f9d92ae..ab013d2de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,12 +12,15 @@ 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 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 diff --git a/CMakeLists.txt b/CMakeLists.txt index 55d432a5c..14bf3c78d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -139,10 +139,6 @@ if(CABLE_LIBRARY) 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 ) @@ -156,6 +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/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 ) if(CMAKE_Fortran_COMPILER_ID MATCHES "Intel") add_compile_options(-r8 -i8) @@ -165,6 +165,31 @@ if(CABLE_LIBRARY) message(STATUS "Cannot compile library with unknown compiler") 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") + 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()