Skip to content

Commit

Permalink
Merge branch 'refactoring' into mzapponi_refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
JanStreffing authored Mar 12, 2024
2 parents 1207cea + 9bb281b commit bbd369f
Show file tree
Hide file tree
Showing 45 changed files with 2,114 additions and 1,034 deletions.
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 }}
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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ set(OIFS_COUPLED OFF CACHE BOOL "compile fesom coupled to OpenIFS. (Also needs F
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(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(VERBOSE OFF CACHE BOOL "toggle debug output")
#add_subdirectory(oasis3-mct/lib/psmile)
Expand Down
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)

33 changes: 29 additions & 4 deletions cmake/FindNETCDF.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ if(CMAKE_Fortran_COMPILER_LOADED)
if(HAVE_Fortran_NETCDF)
set(NETCDF_Fortran_INCLUDE_DIRECTORIES "")
set(NETCDF_Fortran_LIBRARIES "")
set(NETCDF_Fortran_FOUND 1)
else()
find_path(NETCDF_Fortran_INCLUDE_DIRECTORIES netcdf.inc HINTS $ENV{NETCDF_DIR}/include ENV NETCDF_Fortran_INCLUDE_DIRECTORIES)
find_path(NETCDF_Fortran_INCLUDE_DIRECTORIES netcdf.inc HINTS $ENV{NETCDF_ROOT}/include $ENV{NETCDF_DIR}/include $ENV{NETCDF4_DIR}/include ENV NETCDF_Fortran_INCLUDE_DIRECTORIES)
find_library(NETCDF_Fortran_LIBRARIES netcdff HINTS ${NETCDF_Fortran_INCLUDE_DIRECTORIES}/../lib)
if( NETCDF_Fortran_INCLUDE_DIRECTORIES AND NETCDF_Fortran_LIBRARIES )
set(NETCDF_Fortran_FOUND 1)
endif()
endif()
endif()

Expand All @@ -27,14 +31,18 @@ if(CMAKE_C_COMPILER_LOADED OR CMAKE_CXX_COMPILER_LOADED)
if(HAVE_C_NETCDF)
set(NETCDF_C_INCLUDE_DIRECTORIES "")
set(NETCDF_C_LIBRARIES "")
set(NETCDF_C_FOUND 1)
else()
find_path(NETCDF_C_INCLUDE_DIRECTORIES netcdf.h HINTS $ENV{NETCDF_DIR}/include ENV NETCDF_C_INCLUDE_DIRECTORIES)
find_path(NETCDF_C_INCLUDE_DIRECTORIES netcdf.h HINTS $ENV{NETCDF_ROOT}/include $ENV{NETCDF_DIR}/include $ENV{NETCDF4_DIR}/include ENV NETCDF_C_INCLUDE_DIRECTORIES)
find_library(NETCDF_C_LIBRARIES netcdf HINTS ${NETCDF_C_INCLUDE_DIRECTORIES}/../lib)
if( NETCDF_C_INCLUDE_DIRECTORIES AND NETCDF_C_LIBRARIES )
set(NETCDF_C_FOUND 1)
endif()
endif()
endif()

if(CMAKE_CXX_COMPILER_LOADED)
find_path(NETCDF_CXX_INCLUDE_DIRECTORIES netcdf HINTS $ENV{NETCDF_DIR}/include ENV NETCDF_CXX_INCLUDE_DIRECTORIES)
find_path(NETCDF_CXX_INCLUDE_DIRECTORIES netcdf HINTS $ENV{NETCDF_ROOT}/include $ENV{NETCDF_DIR}/include $ENV{NETCDF4_DIR} ENV NETCDF_CXX_INCLUDE_DIRECTORIES)
# the cray toolchain (e.g. hlrn) disables dynamic linking by default. to enable it at build time do e.g. "CRAYPE_LINK_TYPE=dynamic make".
find_library(NETCDF_CXX_LIBRARIES NAMES netcdf_c++4 netcdf-cxx4 HINTS ${NETCDF_CXX_INCLUDE_DIRECTORIES}/../lib)
if(NETCDF_CXX_INCLUDE_DIRECTORIES AND NETCDF_C_INCLUDE_DIRECTORIES)
Expand All @@ -43,4 +51,21 @@ if(CMAKE_CXX_COMPILER_LOADED)
if(NETCDF_CXX_LIBRARIES AND NETCDF_C_LIBRARIES)
list(APPEND NETCDF_CXX_LIBRARIES ${NETCDF_C_LIBRARIES})
endif()
endif()
if( NETCDF_CXX_INCLUDE_DIRECTORIES AND NETCDF_CXX_LIBRARIES )
set(NETCDF_CXX_FOUND 1)
endif()
endif()

if(NOT ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
set(${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS C)
endif()

unset({CMAKE_FIND_PACKAGE_NAME}_REQUIRED_VARS)
foreach(COMP C CXX Fortran)
if("${COMP}" IN_LIST ${CMAKE_FIND_PACKAGE_NAME}_FIND_COMPONENTS)
list(APPEND ${CMAKE_FIND_PACKAGE_NAME}_REQUIRED_VARS NETCDF_${COMP}_FOUND)
endif()
endforeach()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(${CMAKE_FIND_PACKAGE_NAME} HANDLE_COMPONENTS REQUIRED_VARS ${CMAKE_FIND_PACKAGE_NAME}_REQUIRED_VARS)

19 changes: 19 additions & 0 deletions cmake/FindOASISYAC.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
find_path(OASIS_Fortran_INCLUDE_DIRECTORIES mod_oasis.mod HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile)
find_library(OASIS_Fortran_LIBRARIES psmile HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile)

find_path(MCT_Fortran_INCLUDE_DIRECTORIES mct_mod.mod HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/mct)
find_library(MCT_Fortran_LIBRARIES mct HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/mct)

find_path(MPEU_Fortran_INCLUDE_DIRECTORIES m_mpout.mod HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/mct)
find_library(MPEU_Fortran_LIBRARIES mpeu HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/mct)

find_path(SCRIP_Fortran_INCLUDE_DIRECTORIES remap_bicubic_reduced.mod HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/scrip)
find_library(SCRIP_Fortran_LIBRARIES scrip HINTS ${TOPLEVEL_DIR}/../oasis/build/lib/psmile/scrip)

find_path(YAC_Fortran_INCLUDE_DIRECTORIES mo_yac_utils.mod HINTS ${TOPLEVEL_DIR}/../oasis/lib/yac/include)
find_library(YACUTILS_Fortran_LIBRARIES yac_utils HINTS ${TOPLEVEL_DIR}/../oasis/lib/yac/lib)
find_library(YACCORE_Fortran_LIBRARIES yac_core HINTS ${TOPLEVEL_DIR}/../oasis/lib/yac/lib)

find_path(YAXT_Fortran_INCLUDE_DIRECTORIES yaxt.mod HINTS ${TOPLEVEL_DIR}/../oasis/lib/yaxt/include)
find_library(YAXT_Fortran_LIBRARIES yaxt HINTS ${TOPLEVEL_DIR}/../oasis/lib/yaxt/lib)
find_library(YAXTC_Fortran_LIBRARIES yaxt_c HINTS ${TOPLEVEL_DIR}/../oasis/lib/yaxt/lib)
2 changes: 2 additions & 0 deletions config/namelist.cvmix
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ idemix_mu0 = 0.33333333 ! dissipation parameter (dimensionless)
idemix_sforcusage = 0.2
idemix_n_hor_iwe_prop_iter = 5 ! iterations for contribution from horiz. wave propagation
idemix_surforc_file = '/work/ollie/clidyn/forcing/IDEMIX/fourier_smooth_2005_cfsr_inert_rgrid.nc'
idemix_surforc_vname= 'var706'
idemix_botforc_file = '/work/ollie/clidyn/forcing/IDEMIX/tidal_energy_gx1v6_20090205_rgrid.nc'
idemix_botforc_vname= 'wave_dissipation'
/

! namelist for PP
Expand Down
Loading

0 comments on commit bbd369f

Please sign in to comment.