Giter Site home page Giter Site logo

open-surfex's Introduction

Open-SURFEX

CI Build status

SURFEX (SURFace EXternalisée) is a modelling platform that parametrizes land and water surfaces. SURFEX is being developed by Météo-France and Open-SURFEX is a freely available SURFEX version released under terms of CECILL-C Licence.

Differences from the vanilla Open-SURFEX

This fork was created mainly to test the cmake-based build system as a replacement for the original makefile-based build. It also contains a number of minor bug fixes.

How to build Open-SURFEX with cmake-based build

Required tools

  • cmake version 3.11 or newer
  • Fortran compiler (configuration files are available for GNU, Intel and Cray Fortran compilers)

Build instructions

Clone Open-SURFEX repository to your machine and navigate into the cloned source directory.

To build Open-SURFEX with bundled NetCDF and GRIB API libraries and install under the specified directory use the following commands:

> mkdir build && cd build
> cmake .. -DCMAKE_INSTALL_PREFIX=<path to the installation directory>
> cmake --build .
> cmake --build . --target install

To speed-up the compilation process on a multi-core machine, the required flags could be passed in the following form:

> # In case of cmake 'Unix Makefiles' generator.
> cmake --build . -- -j<number of parallel make processes>

To build Open-SURFEX using system-provided NetCDF and GRIB API libraries:

> mkdir build && cd build
> cmake .. -DBUILD_NETCDF=OFF -DBUILD_GRIB_API=OFF
> cmake --build .

If NetCDF and GRIB API libraries are installed in non-standard locations, e.g. when Environment Modules are used, this information should be provided to cmake in the following form:

cmake .. -DBUILD_NETCDF=OFF -DBUILD_GRIB_API=OFF -DNETCDF_DIR=<path to NetCDF> -DGRIB_API_DIR=<path to GRIB API>

The following additional options could be provided as arguments for cmake during the configuration stage:

  • -DENABLE_OMP=ON compile Open-SURFEX with OpenMP multiprocessing;
  • -DENABLE_MPI=ON compile Open-SURFEX with MPI support, requires installed MPI libraries;
  • -DINSPECT_MASTER_SOURCES=ON check code for subroutines and functions that are placed outside Fortran modules;
  • -DUSER_SOURCES_DIR=<path to user sources> add sources from the provided directory to the list of SURFEX' source files. This option reproduces the VER_USER functionality of the original build system and could be used to modify some source files without changing them in the original source tree;
  • -DMANGLE_SURFEX_BINARIES=ON decorate compiled binaries to produce unique file name based on the current build environment. This option could be used to compile a number of different configurations of Open-SURFEX and install all of them under the same directory.

How to build Open-SURFEX with original build system

Consult the official documentation at http://www.cnrm-game-meteo.fr/surfex

open-surfex's People

Contributors

joewkr avatar knedlsepp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

open-surfex's Issues

Unable to build Open-SURFEX with CMake on Cygwin

Hi!

I am building open-SURFEX on windows with Cygwin. I am using CMake version 3.12.0. I have successfully built open-SURFEX on my debian before so I was using the same commands on cygwin.

When I type mkdir build && cd build, cmake .. -DCMAKE_INSTALL_PREFIX=../_install, the error message below shows up.

The problems seem to be that CMake thinks there are already targets with the same name. But I used find -name 'prep' and I did not find any targets with the same name.

This is the log: CMakeOutput.log

Why this is happening? Could you suggest a possible solution for this?

Thank you in advance!

$ cmake .. -DCMAKE_INSTALL_PREFIX=../_install
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++.exe
-- Check for working CXX compiler: /usr/bin/c++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The Fortran compiler identification is GNU 7.3.0
-- Check for working Fortran compiler: /usr/bin/gfortran.exe
-- Check for working Fortran compiler: /usr/bin/gfortran.exe  -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/gfortran.exe supports Fortran 90
-- Checking whether /usr/bin/gfortran.exe supports Fortran 90 -- yes
-- CMAKE_BUILD_TYPE is not set, switching to RELEASE
-- Using /home/alaph/open-SURFEX/conf/config.GNU.cmake
CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "oi_main" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/alaph/open-SURFEX".  See documentation for
  policy CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "soda" because another target with the
  same name already exists.  The existing target is an executable created in
  source directory "/home/alaph/open-SURFEX".  See documentation for policy
  CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "varassim" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/alaph/open-SURFEX".  See documentation for
  policy CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "ncpost" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/alaph/open-SURFEX".  See documentation for
  policy CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "offline" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/alaph/open-SURFEX".  See documentation for
  policy CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "pgd" because another target with the
  same name already exists.  The existing target is an executable created in
  source directory "/home/alaph/open-SURFEX".  See documentation for policy
  CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "prep" because another target with the
  same name already exists.  The existing target is an executable created in
  source directory "/home/alaph/open-SURFEX".  See documentation for policy
  CMP0002 for more details.


CMake Error at CMakeLists.txt:212 (add_executable):
  add_executable cannot create target "sxpost" because another target with
  the same name already exists.  The existing target is an executable created
  in source directory "/home/alaph/open-SURFEX".  See documentation for
  policy CMP0002 for more details.


-- Configuring incomplete, errors occurred!
See also "/home/alaph/open-SURFEX/build/CMakeFiles/CMakeOutput.log".

Missing OPTIONS.nam; Which binary should I use and can I build without netCDF or GRIB-API?

Hi! Thank you for this cmake version of open-SURFEX.

I built using the following commands

 mkdir build && cd build
 cmake .. -DCMAKE_INSTALL_PREFIX=../_install
 cmake --build .
 cmake --build . --target install

While I found a couple of binaries in _install, SODA, SXPOST, VARASSIM, PGD, OI_MAIN, OFFLINE, NCPOST. They all report error opening OPTIONS.nam to me.

In LISTING_SODA0.txt, I also have

 ERROR WHILE OPENING OPTIONS.nam                  THIS FILE IS MISSING IN THE RUN DIRECTORY

What is OPTIONS.nam? Which binary should I use to start? Is my way of building correct? I have not install netCDF nor GRIB-API.

Thank you in advance!

output pf5 or other diagnostics

Hello hope this message finds you well!
I am a user who is using your open-SURFEX and wants to output pf5 (or the f2 factor from the surfex codes). I found that this variables is a local variable in the isba.f90 script (please correct me if I missed something). So how can I output it? by the way, I found that in https://github.com/joewkr/open-SURFEX/blob/master/src/SURFEX/modd_diag_misc_isban.F90, there is a comment:
! B. Decharme 07/2012 : New diag for DIF under LSURF_MISC_DIF key
!! F2 stress
!! Root zone swi, wg and wgi
!! swi, wg and wgi comparable to ISBA-FR-DG2 and DG3 layers
but I didn't find f2 stress in the type DIAG_MISC_ISBA_t. And I found from https://www.umr-cnrm.fr/surfex/spip.php?article96 LSURF_MISC_DIF allows people to output diagnostics as the users wish (please correct me if I was wrong). So how can I use that?
By the way, I found that from the definition, f2 seems has a same calculation as liquid soil wetness index (swirl). Is that correct? can I use swi as f2?
Thanks and hope for your early reply!
Sincerely

Thank you

The original SURFEX build system is a real pain. I guess we should talk to Stéphanie Faroux to get this integrated in the official SURFEX.

USER_SOURCES_DIR: Provide more than one directory

A directory with user source files could be provided via USER_SOURCES_DIR option, but sometimes sources from several directories should be used. It should be possible to define a list of user directories through USER_SOURCES_DIR.

Add option to build open-SURFEX with ecCodes

The GRIB-API library that is used by open-SURFEX to read GRIB files will be no longer maintained after the end of 2018 and ECMWF recommends to switch the new ecCodes library.

It would be nice to have an option to build open-SURFEX with ecCodes, while GRIB-API could still be the default GRIB library for the time being.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.