From 948c8c7fd19e0159e2be8ae7b619ab705b37ccfe Mon Sep 17 00:00:00 2001 From: Jorn Bruggeman Date: Sat, 25 Jan 2025 16:14:06 +0000 Subject: [PATCH] add selmaprotbas to list of optional models (#107) * add selmaprotbas to list of optional models * try fixing aocc by using python rather than python3 * install python after aocc * aocc: show python executable path * debug aocc * debug aocc * add aocc 5.0; debug aocc * debug aocc * debug aocc * debug aocc * debug aocc * debug aocc * debug aocc * clean-up * type correction * suppress aocc/flang warning * disable aocc-5-0 testing (buggy) * reduce unnecessary differences with master * drop special treatment of horizontal_shape --- .github/workflows/fabm.yml | 26 ++++++++++++++++---------- src/CMakeLists.txt | 3 ++- src/builtin/depth_mapping.F90 | 2 +- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/fabm.yml b/.github/workflows/fabm.yml index 1ac15134..768dacfa 100644 --- a/.github/workflows/fabm.yml +++ b/.github/workflows/fabm.yml @@ -48,9 +48,9 @@ jobs: with: submodules: recursive - name: Run all test cases with host emulators - run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} + run: python util/developers/run_all_testcases.py harness --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} - name: Run all test cases with pyfabm - run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} + run: python util/developers/run_all_testcases.py pyfabm --show_logs --compiler gfortran-${{ matrix.version }} ${{ matrix.cmake_args }} ifort: # for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/intel-oneapi-compilers/package.py if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository @@ -87,11 +87,11 @@ jobs: - name: Run all test cases with host emulators run: | source ${HOME}/intel/setvars.sh - python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifort + python util/developers/run_all_testcases.py harness --show_logs --compiler ifort - name: Run all test cases with pyfabm run: | source ${HOME}/intel/setvars.sh - python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifort + python util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifort env: FFLAGS: ${{ env.FFLAGS }} -fp-model precise -fp-model source ifx: @@ -132,13 +132,13 @@ jobs: - name: Run all test cases with host emulators run: | source ${HOME}/intel/setvars.sh - python3 util/developers/run_all_testcases.py harness --show_logs --compiler ifx + python util/developers/run_all_testcases.py harness --show_logs --compiler ifx env: FFLAGS: ${{ matrix.fflags }} - name: Run all test cases with pyfabm run: | source ${HOME}/intel/setvars.sh - python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifx + python util/developers/run_all_testcases.py pyfabm --show_logs --compiler ifx env: FFLAGS: ${{ matrix.fflags }} -fp-model=precise nvfortran: @@ -187,9 +187,9 @@ jobs: with: submodules: recursive - name: Run all test cases with host emulators - run: python3 util/developers/run_all_testcases.py harness --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran + run: python util/developers/run_all_testcases.py harness --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran - name: Run all test cases with pyfabm - run: python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran + run: python util/developers/run_all_testcases.py pyfabm --show_logs --compiler /home/runner/nvhpc/Linux_x86_64/${{ matrix.version }}/compilers/bin/pgfortran aocc: # for available versions, see https://github.com/spack/spack/blob/develop/var/spack/repos/builtin/packages/aocc/package.py if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository @@ -205,6 +205,8 @@ jobs: # url_dir: https://download.amd.com/developer/eula/aocc/aocc-4-1 - version: "4.2.0" # released 2024-02-27 (LLVM 16.0.3) url_dir: https://download.amd.com/developer/eula/aocc/aocc-4-2 + # - version: "5.0.0" # released 2024-10-10 (LLVM 17.0.6) + # url_dir: https://download.amd.com/developer/eula/aocc/aocc-5-0 fail-fast: false runs-on: ubuntu-latest steps: @@ -227,12 +229,16 @@ jobs: submodules: recursive - name: Run all test cases with host emulators run: | + OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH source /home/runner/setenv_AOCC.sh - python3 util/developers/run_all_testcases.py harness --show_logs --compiler flang + export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH:$LD_LIBRARY_PATH + python util/developers/run_all_testcases.py harness --show_logs --compiler flang - name: Run all test cases with pyfabm run: | + OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH source /home/runner/setenv_AOCC.sh - python3 util/developers/run_all_testcases.py pyfabm --show_logs --compiler flang ${{ matrix.pyfabm_cmake_args }} + export LD_LIBRARY_PATH=$OLD_LD_LIBRARY_PATH:$LD_LIBRARY_PATH + python util/developers/run_all_testcases.py pyfabm --show_logs --compiler flang ${{ matrix.pyfabm_cmake_args }} flang-new: if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository strategy: diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9c485655..54c8a092 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -21,11 +21,12 @@ set(DEFAULT_INSTITUTES pisces # Pelagic Interactions Scheme for Carbon and Ecosystem Studies, https://doi.org/10.5194/gmd-8-2465-2015 pml # Plymouth Marine Laboratory, United Kingdom selma # Simple EcoLogical Model for the Aquatic - PROGNOS + selmaprotbas # Adaptation of SELMA as described in https://doi.org/10.1002/lno.12040 su # Swansea University, United Kingdom uhh # University of Hamburg, Germany ) -set(OPTIONAL_INSTITUTES ersem mops pclake pisces ihamocc ogs) +set(OPTIONAL_INSTITUTES ersem mops pclake pisces ihamocc ogs selmaprotbas) if(CMAKE_CURRENT_LIST_DIR STREQUAL CMAKE_SOURCE_DIR) message(FATAL_ERROR "Please point cmake to the top-level directory with FABM source code, not to its src subdirectory.") diff --git a/src/builtin/depth_mapping.F90 b/src/builtin/depth_mapping.F90 index a09c50a9..f9fe3a1d 100644 --- a/src/builtin/depth_mapping.F90 +++ b/src/builtin/depth_mapping.F90 @@ -167,7 +167,7 @@ subroutine vertical_depth_range_do(self, _ARGUMENTS_DO_) class (type_vertical_depth_range), intent(in) :: self _DECLARE_ARGUMENTS_DO_ - real :: z_center, h, z_top, z_bottom, h_overlap + real(rk) :: z_center, h, z_top, z_bottom, h_overlap _LOOP_BEGIN_ _GET_(self%id_z, z_center)