Skip to content

Commit

Permalink
Merge branch 'main' into refactoring_bugfix_cavity
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickscholz authored Oct 8, 2024
2 parents 97d2441 + e900ff0 commit acf43fc
Show file tree
Hide file tree
Showing 389 changed files with 188,508 additions and 79,263 deletions.
3 changes: 1 addition & 2 deletions .github/inactive_workflows/fesom2_icepack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@ jobs:

- name: prepeare FESOM2_icepack
run: |
sed -i 's/USE_ICEPACK OFF/USE_ICEPACK ON/g' CMakeLists.txt
cd ./src/icepack_drivers/
./download_icepack.sh
cd ../../
- name: Compile model
run: |
bash -l configure.sh ubuntu
bash -l configure.sh ubuntu -DUSE_ICEPACK=ON
- name: Create global test run with ICEPACK
run: |
Expand Down
45 changes: 38 additions & 7 deletions .github/workflows/fesom2.1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,49 @@ jobs:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: koldunovn/fesom2_test:refactoring2
container: ghcr.io/fesom/fesom2_docker:fesom2_test_refactoring-master

# Service containers to run with `gfortran_ubuntu`
steps:
# NK: this changes working directory to fesom2
- uses: actions/checkout@v2


- name: Git safe directory
run: |
git config --global --add safe.directory ${PWD}
- name: Compile model (binary)
run: |
bash -l configure.sh ubuntu
./configure.sh ubuntu
- name: Compile model (library)
- name: Compile model (ifs_interface)
run: |
bash ./test/ifs_interface/configure_lib.sh -l
export BUILD_DIR=$PWD/build.ifs_interface
./configure.sh ubuntu -DENABLE_IFS_INTERFACE=ON -DCMAKE_INSTALL_PREFIX=$PWD/install.ifs_interface
- name: Library exists
- name: Test downstream from install-dir
run: |
bash ./test/ifs_interface/check_exist.sh
export fesom_ROOT=${PWD}
rm -rf test_downstream/build
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=OFF -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Test downstream from ifs_interface build-dir
run: |
export fesom_ROOT=$PWD/build.ifs_interface
rm -rf test_downstream/build
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=ON -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Test downstream from ifs_interface install-dir
run: |
export fesom_ROOT=$PWD/install.ifs_interface
rm -rf test_downstream/build
cmake -S test_downstream -B test_downstream/build -DASSERT_HAVE_IFS_INTERFACE=ON -DASSERT_FESOM_DIR=${fesom_ROOT}
cmake --build test_downstream/build
test_downstream/build/main
- name: Create global test run
run: |
Expand All @@ -44,6 +69,12 @@ jobs:
run: |
cd work_pi
fcheck .
- name: Check UGRID Compliance
run: |
pip install ugrid-checks xarray
# Needed to combine the mesh diag and output
python3 -c "import xarray as xr; ds1 = xr.open_dataset('./test/output_pi/sst.fesom.1948.nc'); ds2 = xr.open_dataset('./test/output_pi/fesom.mesh.diag.nc'); xr.merge([ds1, ds2]).to_netcdf('./test/output_pi/merged_ugrid_check.nc')"
ugrid-checker ./test/output_pi/merged_ugrid_check.nc
- name: Check restarts
run: |
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/fesom2_openmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,20 @@ jobs:
# Containers must run in Linux based operating systems
runs-on: ubuntu-latest
# Docker Hub image that `container-job` executes in
container: koldunovn/fesom2_test:refactoring2
container: ghcr.io/fesom/fesom2_docker:fesom2_test_refactoring-nightly

# Service containers to run with `gfortran_ubuntu`
steps:
# NK: this changes working directory to fesom2
- uses: actions/checkout@v2

- name: switch OpenMP ON
- name: Git safe directory
run: |
cd ./src/
sed -i 's/with OpenMP\" OFF/with OpenMP\" ON/g' CMakeLists.txt
cd ../
git config --global --add safe.directory ${PWD}
- name: Compile model
run: |
bash -l configure.sh ubuntu
bash -l configure.sh ubuntu -DENABLE_OPENMP=ON
- name: Create global test run with 4 OpenMP threads
run: |
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/lumi-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Run CICD on Lumi (using .gitlab-ci.yml)

on:
push:
branches:
- refactoring
- lumi_gpu_evatali

jobs:
gitlabsync:
runs-on: ubuntu-latest
steps:
- name: "Check out code"
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Gitlab mirror and CI"
uses: "tiggi/gitlab-mirror-and-ci-action@tiggi/fixes"
with:
args: "https://gitlab.com/lumi-cicd/fesom2.git"
env:
FOLLOW_TAGS: "true"
FORCE_PUSH: "true"
GITLAB_HOSTNAME: "gitlab.com"
GITLAB_USERNAME: "tiggi"
GITLAB_PASSWORD: ${{ secrets.GITLAB_PASSWORD }}
GITLAB_PROJECT_ID: "51374059"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/build
/build.lib
/work
/lib64
*.o
*.mod
*.x
Expand All @@ -12,3 +14,4 @@ lib/*.so
/work_*
Makefile.in
mesh_part/build
test/output_pi
12 changes: 12 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
fesom-job:
stage: build
variables:
SCHEDULER_PARAMETERS: "-N 1 -n 56 --mem=32G -p dev-g -t 00:30:00 -A project_462000376"
tags:
- lumi
# artifacts:
# paths:
# - fesom_build.log
script:
- echo "building fesom branch"
- bash -l configure.sh lumi
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.9"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: docs/requirements.txt
30 changes: 22 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,37 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.16)

# set default build type cache entry (do so before project(...) is called, which would create this cache entry on its own)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "setting default build type: Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
message(STATUS "setting default build type: Release")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
endif()

project(FESOM2.0)

set(CMAKE_VERBOSE_MAKEFILE ON)

option(BUILD_SHARED_LIBS "Build using shared libraries" OFF) # cmake-internal switch to toggle if library targets are being build as STATIC or SHARED, see https://cmake.org/cmake/help/latest/guide/tutorial/Selecting%20Static%20or%20Shared%20Libraries.html
set(BUILD_SHARED_LIBS ON CACHE BOOL "Default to using shared libs")
set(TOPLEVEL_DIR ${CMAKE_CURRENT_LIST_DIR})
set(FESOM_COUPLED OFF CACHE BOOL "compile fesom standalone or with oasis support (i.e. coupled)")
set(OIFS_COUPLED OFF CACHE BOOL "compile fesom coupled to OpenIFS. (Also needs FESOM_COUPLED to work)")
set(CRAY OFF CACHE BOOL "compile with cray ftn")
set(USE_ICEPACK OFF CACHE BOOL "compile fesom with the Iceapck modules for sea ice column physics.")
set(OPENMP_REPRODUCIBLE OFF CACHE BOOL "serialize OpenMP loops that are critical for reproducible results")

#set(VERBOSE OFF CACHE BOOL "toggle debug output")
set(RECOM_COUPLED OFF CACHE BOOL "compile fesom including biogeochemistry, REcoM3")
set(CISO_COUPLED OFF CACHE BOOL "compile ciso coupled to REcoM3. RECOM_COUPLED has to be active")
set(USE_MULTIO OFF CACHE BOOL "Use MULTIO for IO, either grib or binary for now. This also means path to MULTIO installation has to provided using env MULTIO_INSTALL_PATH='..' and multio configuration yamls must be present to run the model with MULTIO")
set(OASIS_WITH_YAC OFF CACHE BOOL "Useing a version of OASIS compiled with YAC instead of SCRIP for interpolation?")
set(ASYNC_ICEBERGS ON CACHE BOOL "compile fesom with or without support for asynchronous iceberg computations")
set(VERBOSE OFF CACHE BOOL "toggle debug output")
#add_subdirectory(oasis3-mct/lib/psmile)
add_subdirectory(src)

foreach( _file fesom-config.cmake fesom-config-version.cmake fesom-targets.cmake )
execute_process( COMMAND ${CMAKE_COMMAND} -E create_symlink ${PROJECT_BINARY_DIR}/src/${_file} ${PROJECT_BINARY_DIR}/${_file} )
endforeach()

# Define ${PROJECT_NAME}_DIR in PARENT_SCOPE so that a `find_package( <this-project> )` in a bundle
# will easily find the project without requiring a `HINT <this-project>_BINARY_DIR` argument
if( NOT CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR )
# Guard needed because PARENT_SCOPE cannot be used in top-level CMake project

set( fesom_DIR ${fesom_DIR} PARENT_SCOPE )
endif()
9 changes: 0 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,3 @@ References
* **[Version with ICEPACK sea ice thermodynamics]** Zampieri, Lorenzo, Frank Kauker, Jörg Fröhle, Hiroshi Sumata, Elizabeth C. Hunke, and Helge Goessling. Impact of Sea-Ice Model Complexity on the Performance of an Unstructured-Mesh Sea-ice/ocean Model Under Different Atmospheric Forcings. Washington: American Geophysical Union, 2020. https://dx.doi.org/10.1002/essoar.10505308.1.

* **[Version coupled with OpenIFS atmosphere]** Streffing, J., Sidorenko, D., Semmler, T., Zampieri, L., Scholz, P., Andrés-Martínez, M., et al ( 2022). AWI-CM3 coupled climate model: description and evaluation experiments for a prototype post-CMIP6 model. Geoscientific Model Development, 15. https://doi.org/10.5194/gmd-15-6399-2022

Documentation for FESOM2
************************

Here lives FESOM2 documentation

Rendered version: https://fesom2.readthedocs.io/en/latest/


61 changes: 0 additions & 61 deletions cmake/FindBLAS.cmake

This file was deleted.

50 changes: 50 additions & 0 deletions cmake/FindMULTIO.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# FindMULTIO.cmake

include(FindPackageHandleStandardArgs)

# Use the environment variable as a hint
set(MULTIO_HINT_PATH $ENV{MULTIO_INSTALL_PATH})

# Try to find the library
find_library(MULTIO_FAPI_LIBRARY
NAMES multio-fapi # Adjust this if the library name is different
HINTS ${MULTIO_HINT_PATH}/lib
)

# Try to find the dependency library
find_library(MULTIO_API_LIBRARY
NAMES multio-api
HINTS ${MULTIO_HINT_PATH}/lib
)

# Try to find the dependency library
find_library(MULTIO_LIBRARY
NAMES multio
HINTS ${MULTIO_HINT_PATH}/lib
)

# Try to find the Fortran module path
find_path(MULTIO_MODULE_PATH
NAMES multio_api.mod # Replace <module_name> with an actual module name you expect to find
HINTS ${MULTIO_HINT_PATH}/module ${MULTIO_HINT_PATH}/multio/module
)


# Aggregate the libraries for easier linking
set(MULTIO_LIBRARIES ${MULTIO_FAPI_LIBRARY} ${MULTIO_API_LIBRARY} ${MULTIO_LIBRARY})


# Handle the results
find_package_handle_standard_args(MULTIO
REQUIRED_VARS MULTIO_LIBRARIES MULTIO_MODULE_PATH
FOUND_VAR MULTIO_FOUND
)

# If found, set the MULTIO_LIBRARIES and MULTIO_INCLUDE_DIRS variables for easy use
if(MULTIO_FOUND)
set(MULTIO_INCLUDE_DIRS ${MULTIO_MODULE_PATH})
endif()

# Mark variables as advanced
mark_as_advanced(MULTIO_LIBRARY MULTIO_MODULE_PATH)

Loading

0 comments on commit acf43fc

Please sign in to comment.