Giter Site home page Giter Site logo

hpscterrsys / eclm Goto Github PK

View Code? Open in Web Editor NEW
8.0 12.0 13.0 14.64 MB

Fork of Community Land Model v5.0

Home Page: https://hpscterrsys.github.io/eCLM/

License: Other

Shell 0.01% CMake 0.32% Fortran 97.23% C 0.02% Perl 0.20% C++ 0.20% Makefile 0.03% HTML 0.01% Python 1.99%
climate land land-surface-model hydrology fortran python cmake parflow

eclm's Introduction

eCLM

CI status: alpha

eCLM is based from Community Land Model 5.0 (CLM5.0). It has the same modelling capabilities as CLM5 but with a more simplified infrastructure for build and namelist generation. The build system is handled entirely by CMake and namelists are generated through a small set of Python scripts. Only Fortran source codes necessary for a functional land model simulation were imported from CLM5.

Unlike CLM5, there are no built-in batch scripts in eCLM. It is up to system maintainers or users to craft their own workflows by combining the basic tools in this repo plus the native tools in their respective platforms.

Installation

This section shows you how to install eCLM on your local machine. If you are a user in IBG-3 and wish to run eCLM on JSC supercomputers, please check out the eCLM-JSC repo.

Minimum system requirements

  • MPI 3.1
  • netCDF-C 4.7.4
  • netCDF-Fortran 4.5.2
  • PnetCDF 1.12.1
  • LAPACK
  • CMake 3.16
  • Supported compilers
    • GCC 9.3.0
    • Intel 19.1.2

Building eCLM

  1. Configure CMake build options.
# User-specific variables
BUILD_DIR="bld"
INSTALL_DIR="eclm"

# Run cmake
cmake -S src -B "$BUILD_DIR" \
      -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
      -DCMAKE_C_COMPILER=mpicc \
      -DCMAKE_Fortran_COMPILER=mpifort

Additionally, you may specify these optional build variables.

  • CMAKE_BUILD_TYPE=DEBUG|RELEASE. Defaults to RELEASE.
  • CMAKE_PREFIX_PATH. Semicolon-separated list of paths (i.e. install prefixes) where external libraries might be found. You may need to specify this if CMake cannot find some of the required libraries (e.g. NetCDF, PnetCDF, LAPACK).
  1. Build and install eCLM.
cmake --build "$BUILD_DIR"
cmake --install "$BUILD_DIR"

Install namelist generator Python package

The namelist generator scripts require Python 3.X.

# Upgrade to latest version of pip
python3 -m pip install --upgrade pip

# Install package
pip3 install --user ./namelist_generator

Run sample test case

# Download and extract data files
wget https://datapub.fz-juelich.de/slts/eclm/1x1_wuestebach.tar.gz
mkdir 1x1_wuestebach
tar xf 1x1_wuestebach.tar.gz -C 1x1_wuestebach

# Generate namelists
cd 1x1_wuestebach
export DATA_DIR="$(pwd)"
clm5nl-gen wtb_1x1.toml

# Validate namelists
clm5nl-check .

# Run eCLM
/path/to/eclm.exe

Status

eCLM has only been lightly tested; so far it could run a single-point and a regional case in Germany. Still, more work has to be done to ensure the correctness of the build process and the generated namelists. A user-friendly and lightweight approach to model configuration also has to be developed. eCLM is still in alpha version and would not be ready for production runs anytime soon.

eclm's People

Contributors

jjokella avatar kongdd avatar kvrigor avatar mvhulten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eclm's Issues

clm5nl-gen error

I am using the eCLM docker image. The example in eCLM has the following error.
Any idea how to fix this problem?

docker run -it --rm -e "TERM=xterm-256color" \
    -v ${PWD}:/home/clmuser/eclm \
    -v /media/kong/Document/1x1_wuestebach:/home/clmuser/eclm/1x1_wuestebach \
    hpscterrsys/eclm bash

cd 1x1_wuestebach
export DATA_DIR="$(pwd)"
clm5nl-gen wtb_1x1.toml
Reading model parameters file from /home/clmuser/eclm/1x1_wuestebach/wtb_1x1.toml
Namelists will be saved to /home/clmuser/eclm/1x1_wuestebach
--> Generated drv_in
Traceback (most recent call last):
  File "/home/clmuser/.local/bin/clm5nl-gen", line 121, in <module>
    err_code = generate_namelists(params_file, out_dir)
  File "/home/clmuser/.local/bin/clm5nl-gen", line 69, in generate_namelists
    success, msg = build_namelist(nl, opts, out_dir)
  File "/home/clmuser/.local/lib/python3.9/site-packages/clm5nl/generators/__init__.py", line 26, in build_namelist
    success, status_msg = build_lnd_in(opts, out_file)   
  File "/home/clmuser/.local/lib/python3.9/site-packages/clm5nl/generators/gen_lnd_in.py", line 63, in build_lnd_in
    process_namelist_inline_logic()                # rest of namelist parameters
  File "/home/clmuser/.local/lib/python3.9/site-packages/clm5nl/generators/gen_lnd_in.py", line 142, in process_namelist_inline_logic
    setup_logic_delta_time()
  File "/home/clmuser/.local/lib/python3.9/site-packages/clm5nl/generators/gen_lnd_in.py", line 444, in setup_logic_delta_time
    error("can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable.")
  File "/home/clmuser/.local/lib/python3.9/site-packages/clm5nl/generators/gen_lnd_in.py", line 130, in error
    raise ValueError(msg)
ValueError: can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable.

Build failure due to a circular dependency

This bug was introduced by #17. CMake detects a circular dependency originating
from BalanceCheckMod.F90 which leads to a compile error in clm_instMod.F90.
I assume CMake is smart enough to avoid this, and yet we encounter this error.

[ 72%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/GlacierSurfaceMassBalanceMod.F90.o
gmake[2]: Circular clm5/CMakeFiles/clm.dir/main/clm_instMod.F90.o <- clm5/CMakeFiles/clm.dir/balancecheckmod.mod.stamp dependency dropped.
[ 72%] Building Fortran object clm5/CMakeFiles/clm.dir/main/initVerticalMod.F90.o
[ 72%] Building Fortran object clm5/CMakeFiles/clm.dir/main/lnd2glcMod.F90.o
[ 73%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/OzoneMod.F90.o
[ 73%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/OzoneOffMod.F90.o
[ 73%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/OzoneFactoryMod.F90.o
[ 74%] Building Fortran object clm5/CMakeFiles/clm.dir/main/organicFileMod.F90.o
[ 74%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SoilHydrologyInitTimeConstMod.F90.o
[ 74%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SoilStateInitTimeConstMod.F90.o
[ 74%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90.o
../eCLM/src/clm5/biogeophys/SoilWaterRetentionCurveClappHornberg1978Mod.F90(35): warning #6178: The return value of this FUNCTION has not been defined.   [CONSTRUCTOR]
  type(soil_water_retention_curve_clapp_hornberg_1978_type) function constructor()
---------------------------------------------------------------------^
[ 74%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90.o
../eCLM/src/clm5/biogeophys/SoilWaterRetentionCurveVanGenuchten1980Mod.F90(35): warning #6178: The return value of this FUNCTION has not been defined.   [CONSTRUCTOR]
  type(soil_water_retention_curve_vangenuchten_1980_type) function constructor()
-------------------------------------------------------------------^
[ 75%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SoilWaterRetentionCurveFactoryMod.F90.o
[ 75%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/SurfaceRadiationMod.F90.o
[ 75%] Building Fortran object clm5/CMakeFiles/clm.dir/biogeophys/UrbanTimeVarType.F90.o
[ 76%] Building Fortran object clm5/CMakeFiles/clm.dir/main/clm_instMod.F90.o
../eCLM/src/clm5/main/clm_instMod.F90(189): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [BALANCECHECKMOD]
    use BalanceCheckMod                    , only : GetBalanceCheckSkipSteps
--------^
../eclm/eCLM/src/clm5/main/clm_instMod.F90(395): error #6404: This name does not have a type, and must have an explicit type.   [GETBALANCECHECKSKIPSTEPS]
    call bgc_vegetation_inst%Init(bounds, nlfilename, GetBalanceCheckSkipSteps() )
------------------------------------------------------^
../eCLM/src/clm5/main/clm_instMod.F90(189): error #6580: Name in only-list does not exist or is not accessible.   [GETBALANCECHECKSKIPSTEPS]
    use BalanceCheckMod                    , only : GetBalanceCheckSkipSteps
----------------------------------------------------^
compilation aborted for ../eCLM/src/clm5/main/clm_instMod.F90 (code 1)
gmake[2]: *** [clm5/CMakeFiles/clm.dir/build.make:2859: clm5/CMakeFiles/clm.dir/main/clm_instMod.F90.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:342: clm5/CMakeFiles/clm.dir/all] Error 2

Could NOT find NetCDF (missing: NetCDF_C_INCLUDEDIR NetCDF_F90_INCLUDEDIR NetCDF_F90_LIBRARIES) (found version "")

Hi,
I am Adrien Damseaux, PhD student working with Heidrun Matthes at AWI Potsdam.

I tried to build eCLM on DKRZ mistral but I have some netCDF library issues. It seems there is no module to set netCDF paths on mistral. I need to specify a path for netcdf_c and netcdf_f.

I try to build like below but it's not working. Do you think it is possible to build eCLM in my case?

`cmake -S src -B "$BUILD_DIR" \

  -DCMAKE_INSTALL_PREFIX="$INSTALL_DIR" \
  -DCMAKE_C_COMPILER=mpicc \
  -DCMAKE_Fortran_COMPILER=mpifort \
  -DCMAKE_PREFIX_PATH=/sw/rhel6-x64/netcdf/netcdf_fortran-4.4.3-parallel-openmpi2-intel14/ \
  -DCMAKE_PREFIX_PATH=/sw/rhel6-x64/netcdf/netcdf_c-4.4.0-parallel-openmpi2-intel14/ \
  -DCMAKE_PREFIX_PATH=/sw/rhel6-x64/netcdf/parallel_netcdf-1.6.1-openmpi2-intel14/`

You can find my log here:
CMakeOutput.log

Thanks!

Error running namelist generator of sample test case

Hi,

After installing eCLM on Levante (DKRZ), I am trying to run the sample test case. Here is the error message I have for the namelist generator:

(myenv) [a271098@levante3 1x1_wuestebach]$ export DATA_DIR="$(pwd)"
(myenv) [a271098@levante3 1x1_wuestebach]$ ../namelist_generator/clm5nl-gen wtb_1x1.toml 
Reading model parameters file from /work/aa0049/a271098_tmp/eCLM/1x1_wuestebach/wtb_1x1.toml
Namelists will be saved to /work/aa0049/a271098_tmp/eCLM/1x1_wuestebach
--> Generated drv_in
Traceback (most recent call last):
  File "/work/aa0049/a271098_tmp/eCLM/1x1_wuestebach/../namelist_generator/clm5nl-gen", line 121, in <module>
    err_code = generate_namelists(params_file, out_dir)
  File "/work/aa0049/a271098_tmp/eCLM/1x1_wuestebach/../namelist_generator/clm5nl-gen", line 69, in generate_namelists
    success, msg = build_namelist(nl, opts, out_dir)
  File "/work/aa0049/a271098_tmp/eCLM/namelist_generator/clm5nl/generators/__init__.py", line 26, in build_namelist
    success, status_msg = build_lnd_in(opts, out_file)   
  File "/work/aa0049/a271098_tmp/eCLM/namelist_generator/clm5nl/generators/gen_lnd_in.py", line 63, in build_lnd_in
    process_namelist_inline_logic()                # rest of namelist parameters
  File "/work/aa0049/a271098_tmp/eCLM/namelist_generator/clm5nl/generators/gen_lnd_in.py", line 142, in process_namelist_inline_logic
    setup_logic_delta_time()
  File "/work/aa0049/a271098_tmp/eCLM/namelist_generator/clm5nl/generators/gen_lnd_in.py", line 444, in setup_logic_delta_time
    error("can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable.")
  File "/work/aa0049/a271098_tmp/eCLM/namelist_generator/clm5nl/generators/gen_lnd_in.py", line 130, in error
    raise ValueError(msg)
ValueError: can NOT set both -l_ncpl option (via LND_NCPL env variable) AND dtime namelist variable.
(myenv) [a271098@levante3 1x1_wuestebach]$ 

Any idea what I can do?

Thanks

gcc: error: unrecognized command-line option '-V'

I am trying to build eCLM on DKRZ/Levante.

However, I quickly have an error in the build. Can you help me?

Here is my error message:

[  1%] Performing configure step for 'mct_external'
checking whether the C compiler works... no
configure: error: in `/work/aa0049/a271098_tmp/eCLM/src/externals/mct':
configure: error: C compiler cannot create executables
See `config.log' for more details
gmake[2]: *** [externals/CMakeFiles/mct_external.dir/build.make:125: externals/mct/src/mct_external-stamp/mct_external-configure] Error 77
gmake[1]: *** [CMakeFiles/Makefile2:269: externals/CMakeFiles/mct_external.dir/all] Error 2
gmake: *** [Makefile:149: all] Error 2

CMakeCache.txt
config.log

Tagging eCLM for usage in TSMP2

It may make sense to introduce tags in this repo that can be used for cloning specific commits in TSMP2.

F.e. something like tsmp-patches-v0.1 etc. as it is used for other TSMP2-codes.

Or leaving out the patches as the eCLM is not patched, but more directly developed for TSMP2.

Error with libraries while running eclm.exe

I am still trying to use eCLM on Levante. I came across this error when running eclm.exe :

(base) [a271098@levante6 1x1_wuestebach]$ ../../lib/bin/eclm.exe 
../../lib/bin/eclm.exe: error while loading shared libraries: libmkl_intel_lp64.so.2: cannot open shared object file: No such file or directory

Any ideas what I can do?

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.