From f955df70d290ff08761b95e2c487d82751b83a6c Mon Sep 17 00:00:00 2001 From: Claire Merker <34312518+clairemerker@users.noreply.github.com> Date: Mon, 27 Nov 2023 14:42:41 +0100 Subject: [PATCH] Eccodes workflow (#10) * eccodes_in env * fix missing python-eccodes package and move fieldextra setup and cartopy check to tools/setup_env.sh * delete obsolete setup_grib_eccodes.sh * Update of README.md (removal of Tsa support) --------- Co-authored-by: Andreas Pauling --- README.md | 18 +- requirements/environment.yml | 351 +++++++++++++++-------------- requirements/requirements.yml | 2 + requirements/setup_grib_eccodes.sh | 119 ---------- tools/setup_env.sh | 37 ++- 5 files changed, 236 insertions(+), 291 deletions(-) delete mode 100755 requirements/setup_grib_eccodes.sh diff --git a/README.md b/README.md index b45f978..b7f6411 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,14 @@ This repository calculates the pollen input fields needed for the real-time pollen calibration in ICON-ART. It is very similar to the FORTRAN implementation used in COSMO-ART. More information about the Pollen module currently in the weather model COSMO can be found here: -And in this paper: (currently under review :) +And in this paper: Adamov, S & Pauling, A (2023): A real-time calibration method for the numerical pollen forecast model COSMO-ART +Aerobiologia, 39, 327-344. Available open access from https://link.springer.com/article/10.1007/s10453-023-09796-5 This specific project also has a confluence page here: +The package has been tested on Balfrin at CSCS only. + ## Data Import In the /data folder are case studies for four Species: @@ -38,7 +41,7 @@ In the /notebook folder is a simple script that allows for plotting 2D-maps usin ## Start developing -Once you created or cloned this repository, make sure the installation is running properly. Install the package dependencies with the provided script `setup_env.sh`. +Once you created or cloned this repository, make sure the installation is running properly. Install the package dependencies with the provided script `setup_env.sh`. This script also handles the installation of ecCodes cosmo definitions (for more on ecCode refer to the dedicated section below), sets the fieldextra path and checks the cartopy installation (currently deactivated). Check available options with ```bash @@ -78,6 +81,17 @@ pytest If the tests pass, you are good to go. If not, contact the package administrator Simon Adamov. Make sure to update your requirement files and export your environments after installation every time you add new imports while developing. Check the next section to find some guidance on the development process if you are new to Python and/or APN. +### ecCodes for GRIB decoding + +Since this package uses cfgrib to decode GRIB data, ecCodes must be installed and the ecCodes and COSMO ecCodes definitions +made available. The location of the definitions is stored in the environment variable `GRIB_DEFINITION_PATH` in the conda environment. + ecCodes definitions are installed with the ecCodes library by conda, the COSMO ecCodes definitions are cloned and installed + separately. This is handled by `tools/setup_env.sh` and only needs to be done once, the settings are then stored in the conda + environment! If you need a personalised version of ecCodes definitions, you can specify the path to your version + in `GRIB_DEFINITION_PATH` (and `GRIB_SAMPLES_PATH` if needed) in `tools/setup_env.sh`. + Be aware that the version of the COSMO eccodes definitions need to match the version of the ecCodes library. + Please adapt both `requirements/requirements.yml` and `tools/setup_env.sh` if you need to change the ecCodes version. + ### Roadmap to your first contribution Generally, the source code of your library is located in `src/`. The blueprint will generate some example code in `mutable_number.py`, `utils.py` and `cli.py`. `cli.py` thereby serves as an entry diff --git a/requirements/environment.yml b/requirements/environment.yml index 327e18f..9d8a8c0 100644 --- a/requirements/environment.yml +++ b/requirements/environment.yml @@ -1,251 +1,264 @@ -name: realtime-pollen-calibration +name: RTcal channels: - conda-forge - defaults - - r dependencies: - _libgcc_mutex=0.1 - _openmp_mutex=4.5 - alabaster=0.7.13 - - anaconda-client=1.11.0 - - anyio=3.6.2 - - astroid=2.14.1 - - asttokens=2.2.1 - - attrs=22.2.0 - - babel=2.11.0 - - backcall=0.2.0 - - backports=1.0 - - backports.functools_lru_cache=1.6.4 - - beautifulsoup4=4.11.2 - - black=23.1.0 - - boa=0.14.0 - - brotlipy=0.7.0 + - anaconda-client=1.12.1 + - anaconda-project=0.11.1 + - annotated-types=0.6.0 + - anyio=3.7.1 + - archspec=0.2.2 + - astroid=3.0.1 + - asttokens=2.4.1 + - attrs=23.1.0 + - babel=2.13.1 + - beautifulsoup4=4.12.2 + - black=23.10.1 + - boa=0.16.0 + - boltons=23.0.0 + - brotli-python=1.1.0 - bzip2=1.0.8 - - c-ares=1.18.1 - - ca-certificates=2022.12.7 - - certifi=2022.12.7 - - cffi=1.15.1 - - cfgrib=0.9.10.3 + - c-ares=1.22.1 + - ca-certificates=2023.08.22 + - certifi=2023.11.17 + - cffi=1.16.0 + - cfgrib=0.9.10.4 - cfgv=3.3.1 - - chardet=5.1.0 - - charset-normalizer=2.1.1 - - click=8.1.3 + - chardet=5.2.0 + - charset-normalizer=3.3.2 + - click=8.1.7 - clyent=1.2.2 - - codespell=2.2.2 + - codespell=2.2.6 - colorama=0.4.6 - - conda=22.11.1 - - conda-build=3.23.3 - - conda-package-handling=2.0.2 - - conda-package-streaming=0.7.0 - - cryptography=39.0.0 - - curl=7.87.0 - - dataclasses=0.8 + - conda=23.10.0 + - conda-build=3.27.0 + - conda-index=0.3.0 + - conda-libmamba-solver=23.11.1 + - conda-pack=0.7.1 + - conda-package-handling=2.2.0 + - conda-package-streaming=0.9.0 + - curl=8.4.0 - decorator=5.1.1 - - dill=0.3.6 - - distlib=0.3.6 - - docutils=0.17.1 - - eccodes=2.28.0 - - exceptiongroup=1.1.0 - - executing=1.2.0 - - filelock=3.9.0 - - findlibs=0.0.2 - - flake8=6.0.0 - - flake8-black=0.3.5 - - fmt=9.1.0 + - defusedxml=0.7.1 + - dill=0.3.7 + - distlib=0.3.7 + - docutils=0.20.1 + - eccodes=2.25.0 + - exceptiongroup=1.2.0 + - executing=2.0.1 + - filelock=3.13.1 + - findlibs=0.0.5 + - flake8=6.1.0 + - flake8-black=0.3.6 + - fmt=10.1.1 - freeglut=3.2.2 - - glob2=0.7 + - freetype=2.12.1 - hdf4=4.2.15 - - hdf5=1.12.2 - - icu=70.1 - - identify=2.5.17 - - idna=3.4 + - hdf5=1.12.1 + - icu=73.2 + - identify=2.5.32 + - idna=3.6 - imagesize=1.4.1 - - importlib-metadata=3.3.0 - - importlib_resources=5.10.2 + - importlib-metadata=4.13.0 + - importlib_resources=6.1.1 - iniconfig=2.0.0 - - ipdb=0.13.11 - - ipython=8.9.0 + - ipdb=0.13.13 + - ipython=8.18.0 - isort=5.12.0 - jasper=2.0.33 - - jedi=0.18.2 + - jedi=0.19.1 - jinja2=3.1.2 - - joblib=1.2.0 + - joblib=1.3.2 - jpeg=9e - - json5=0.9.5 - - jsonschema=4.17.3 - - jupyter_core=5.2.0 + - json5=0.9.14 + - jsonpatch=1.33 + - jsonpointer=2.4 + - jsonschema=4.20.0 + - jsonschema-specifications=2023.11.1 + - jupyter_core=5.5.0 - keyutils=1.6.1 - - krb5=1.20.1 - - lazy-object-proxy=1.9.0 - - ld_impl_linux-64=2.40 - - libaec=1.0.6 - - libarchive=3.5.2 + - krb5=1.21.2 + - lcms2=2.15 + - ld_impl_linux-64=2.38 + - lerc=4.0.0 + - libaec=1.1.2 + - libarchive=3.7.2 - libblas=3.9.0 - libcblas=3.9.0 - - libcurl=7.87.0 + - libcurl=8.4.0 + - libdeflate=1.17 - libedit=3.1.20191231 - libev=4.33 - - libffi=3.4.2 - - libgcc-ng=12.2.0 - - libgfortran-ng=12.2.0 - - libgfortran5=12.2.0 + - libffi=3.4.4 + - libgcc-ng=13.2.0 + - libgfortran-ng=13.2.0 + - libgfortran5=13.2.0 - libglu=9.0.0 - - libgomp=12.2.0 + - libgomp=13.2.0 - libiconv=1.17 - liblapack=3.9.0 - liblief=0.12.3 - - libmamba=1.1.0 - - libmambapy=1.1.0 + - libmamba=1.5.3 + - libmambapy=1.5.3 - libnetcdf=4.8.1 - - libnghttp2=1.51.0 - - libnsl=2.0.0 - - libopenblas=0.3.21 + - libnghttp2=1.58.0 + - libopenblas=0.3.25 - libpng=1.6.39 - - libsolv=0.7.22 - - libsqlite=3.40.0 - - libssh2=1.10.0 - - libstdcxx-ng=12.2.0 - - libuuid=2.32.1 + - libsolv=0.7.27 + - libssh2=1.11.0 + - libstdcxx-ng=13.2.0 + - libtiff=4.5.0 + - libuuid=1.41.5 + - libwebp-base=1.3.2 - libxcb=1.13 - - libxml2=2.10.3 - - libzip=1.9.2 + - libxml2=2.11.6 + - libzip=1.10.1 - libzlib=1.2.13 - livereload=2.6.3 - lz4-c=1.9.4 - lzo=2.10 - - mamba=1.1.0 - - markdown-it-py=2.1.0 - - markupsafe=2.1.2 + - mamba=1.5.3 + - markdown-it-py=3.0.0 + - markupsafe=2.1.3 - matplotlib-inline=0.1.6 - mccabe=0.7.0 - mdurl=0.1.0 - - mypy=1.0.0 + - more-itertools=10.1.0 + - mypy=1.7.1 - mypy_extensions=1.0.0 - - nbformat=5.6.0 - - ncurses=6.3 - - nodeenv=1.7.0 - - numpy=1.24.2 - - openssl=3.0.7 - - packaging=23.0 - - pandas=1.5.3 + - nbformat=5.9.2 + - ncurses=6.4 + - nodeenv=1.8.0 + - numpy=1.26.2 + - openjpeg=2.5.0 + - openssl=3.2.0 + - packaging=23.2 + - pandas=2.1.3 - parso=0.8.3 - patch=2.7.6 - patchelf=0.17.2 - - pathspec=0.11.0 + - pathspec=0.11.2 - pexpect=4.8.0 - pickleshare=0.7.5 - - pip=23.0 + - pillow=9.4.0 + - pip=23.3.1 - pkginfo=1.9.6 - pkgutil-resolve-name=1.3.10 - - platformdirs=2.6.2 - - pluggy=1.0.0 - - pre-commit=3.0.4 - - prompt-toolkit=3.0.36 - - prompt_toolkit=3.0.36 - - psutil=5.9.4 + - platformdirs=4.0.0 + - pluggy=1.3.0 + - pre-commit=3.5.0 + - prompt_toolkit=3.0.41 + - psutil=5.9.5 - pthread-stubs=0.4 - ptyprocess=0.7.0 - pure_eval=0.2.2 - py-lief=0.12.3 - pybind11-abi=4 - - pycodestyle=2.10.0 - - pycosat=0.6.4 + - pycodestyle=2.11.1 + - pycosat=0.6.6 - pycparser=2.21 - - pydantic=1.10.4 + - pydantic=2.5.2 + - pydantic-core=2.14.5 - pydocstyle=6.3.0 - - pyflakes=3.0.1 - - pygments=2.14.0 - - pylint=2.16.1 - - pyopenssl=23.0.0 - - pyprojroot=0.2.0 - - pyrsistent=0.19.3 + - pyflakes=3.1.0 + - pygments=2.17.2 + - pylint=3.0.2 + - pyprojroot=0.3.0 - pysocks=1.7.1 - - pytest=7.2.1 - - python=3.11.0 + - pytest=7.4.3 + - python=3.10.13 - python-dateutil=2.8.2 - - python-eccodes=1.5.1 - - python-fastjsonschema=2.16.2 - - python-libarchive-c=4.0 - - python_abi=3.11 + - python-eccodes=1.4.0 + - python-fastjsonschema=2.19.0 + - python-libarchive-c=5.0 + - python-tzdata=2023.3 + - python_abi=3.10 - pytoolconfig=1.2.5 - - pytz=2022.7.1 - - pyyaml=6.0 - - readline=8.1.2 - - reproc=14.2.4 - - reproc-cpp=14.2.4 - - requests=2.28.2 - - rich=13.3.1 + - pytz=2023.3.post1 + - pyyaml=6.0.1 + - readline=8.2 + - referencing=0.31.0 + - reproc=14.2.4.post0 + - reproc-cpp=14.2.4.post0 + - requests=2.31.0 + - requests-toolbelt=1.0.0 + - rich=13.7.0 - ripgrep=13.0.0 - - rope=1.7.0 - - rstcheck=6.1.1 - - rstcheck-core=1.0.3 - - ruamel.yaml=0.17.21 + - rope=1.11.0 + - rpds-py=0.13.1 + - rstcheck=6.2.0 + - rstcheck-core=1.2.0 + - ruamel.yaml=0.18.5 - ruamel.yaml.clib=0.2.7 - - setuptools=65.6.3 - - shellingham=1.5.0.post1 + - ruamel_yaml=0.15.80 + - setuptools=68.0.0 + - shellingham=1.5.4 - six=1.16.0 - sniffio=1.3.0 - snowballstemmer=2.2.0 - - soupsieve=2.3.2.post1 - - sphinx=4.3.2 + - soupsieve=2.5 + - sphinx=7.2.6 - sphinx-autobuild=2021.3.14 - - sphinxcontrib-applehelp=1.0.4 - - sphinxcontrib-devhelp=1.0.2 - - sphinxcontrib-htmlhelp=2.0.1 + - sphinxcontrib-applehelp=1.0.7 + - sphinxcontrib-devhelp=1.0.5 + - sphinxcontrib-htmlhelp=2.0.4 - sphinxcontrib-jsmath=1.0.1 - - sphinxcontrib-qthelp=1.0.3 - - sphinxcontrib-serializinghtml=1.1.5 + - sphinxcontrib-qthelp=1.0.6 + - sphinxcontrib-serializinghtml=1.1.9 + - sqlite=3.41.2 - stack_data=0.6.2 - tk=8.6.12 - toml=0.10.2 - tomli=2.0.1 - - tomlkit=0.11.6 - - toolz=0.12.0 - - tornado=6.2 - - tqdm=4.64.1 - - traitlets=5.9.0 - - typer=0.4.2 - - types-docutils=0.18.3 - - types-setuptools=67.1.0.2 - - types-toml=0.10.8.3 - - typing=3.10.0.0 - - typing-extensions=4.4.0 - - typing_extensions=4.4.0 - - tzdata=2022g + - tomlkit=0.12.3 + - tornado=6.3.3 + - tqdm=4.66.1 + - traitlets=5.13.0 + - truststore=0.8.0 + - typer=0.9.0 + - types-docutils=0.20.0.3 + - types-setuptools=68.2.0.2 + - types-toml=0.10.8.7 + - typing-extensions=4.8.0 + - typing_extensions=4.8.0 + - tzdata=2023c - ukkonen=1.0.1 - - urllib3=1.26.14 - - virtualenv=20.17.1 + - urllib3=2.1.0 + - virtualenv=20.24.7 - watchgod=0.8.2 - - wcwidth=0.2.6 - - wheel=0.38.4 - - wrapt=1.14.1 - - xarray=2023.1.0 + - wcwidth=0.2.12 + - wheel=0.41.2 + - xarray=2023.11.0 - xorg-fixesproto=5.0 - xorg-inputproto=2.3.2 - xorg-kbproto=1.0.7 - - xorg-libx11=1.7.2 - - xorg-libxau=1.0.9 + - xorg-libx11=1.8.4 + - xorg-libxau=1.0.11 - xorg-libxdmcp=1.1.3 - xorg-libxext=1.3.4 - xorg-libxfixes=5.0.3 - xorg-libxi=1.7.10 - xorg-xextproto=7.3.0 - xorg-xproto=7.0.31 - - xz=5.2.6 + - xz=5.4.2 - yaml=0.2.5 - - yaml-cpp=0.7.0 - - zipp=3.12.1 + - yaml-cpp=0.8.0 + - zipp=3.17.0 - zlib=1.2.13 - - zstandard=0.19.0 - - zstd=1.5.2 + - zstandard=0.22.0 + - zstd=1.5.5 - pip: - - copier==7.0.1 - - dunamai==1.15.0 - - flake8-pyproject==1.2.2 - - iteration-utilities==0.11.0 - - jinja2-ansible-filters==1.3.2 - - mistune==2.0.5 - - plumbum==1.8.1 - - pyyaml-include==1.3 - - questionary==1.10.0 - - sphinx-mdinclude==0.5.3 + - copier==9.0.1 + - dunamai==1.19.0 + - flake8-pyproject==1.2.3 + - funcy==2.0 + - jinja2-ansible-filters==1.3.2 + - mistune==2.0.5 + - plumbum==1.8.2 + - prompt-toolkit==3.0.36 + - pyyaml-include==1.3.1 + - questionary==2.0.1 + - sphinx-mdinclude==0.5.3 diff --git a/requirements/requirements.yml b/requirements/requirements.yml index 3adcb9a..ba0b7aa 100644 --- a/requirements/requirements.yml +++ b/requirements/requirements.yml @@ -13,6 +13,7 @@ dependencies: - cfgrib - codespell>=2.2 - conda-build>=3.23 + - eccodes==2.25.0 - flake8>=6.0 - flake8-black>=0.3 - ipdb>=0.13 @@ -26,6 +27,7 @@ dependencies: - pylint>=2.15 - pyprojroot - pytest>=7.2 + - python-eccodes - rich>=12.6 - rope>=1.6 - rstcheck>=6.1 diff --git a/requirements/setup_grib_eccodes.sh b/requirements/setup_grib_eccodes.sh deleted file mode 100755 index d1f4b05..0000000 --- a/requirements/setup_grib_eccodes.sh +++ /dev/null @@ -1,119 +0,0 @@ -#!/bin/bash - -function check_python { - python_version_l=$(python -c 'import sys; print(".".join(map(str, sys.version_info[:3])))') - python_version_maj=$(python -c 'import sys; print(".".join(map(str, sys.version_info[0:1])))') - python_version_min=$(python -c 'import sys; print(".".join(map(str, sys.version_info[1:2])))') - python_lib=$(python --version | tr '[:upper:]' '[:lower:]' | sed 's/ //g' | sed 's/\.[^.]*$//') - - min_required_maj=3 - min_required_min=6 - if [[ $(echo $python_version_maj'>='$min_required_maj | bc -l) == 1 ]] && [[ $(echo $python_version_min'>='$min_required_min | bc -l) == 1 ]] ; then - echo "Python version: $python_version_l" - else - echo -e "\e[31mPython version: $python_version_l\e[0m" - echo -e "\e[31mPlease check your Python version >= 3.6 and make sure that the appropriate Conda env is activated.\e[0m" - exit $1 - fi - if [[ -d "$CONDA_PREFIX/lib/$python_lib" ]]; then - echo "Found $python_lib within Conda environment." - else - echo -e "\e[31mPlease check your Python binary path and make sure that the appropriate Conda environment is activated.\e[0m" - exit $1 - fi -} - -function set_grib_definition_path { - - cosmo_eccodes=$(spack find --format "{prefix}" cosmo-eccodes-definitions@2.19.0.7%gcc | head -n1) - if [[ -d "$cosmo_eccodes" ]]; then - echo 'Cosmo eccodes-definitions were successfully retrieved.' - else - echo -e "\e[31mCosmo eccodes-definitions could not be set properly. Please check your Spack setup.\e[0m" - exit $1 - fi - - eccodes=$(spack find --format "{prefix}" eccodes@2.19.0%gcc \~aec | head -n1) - if [[ -d "$eccodes" ]]; then - echo 'Eccodes definitions were successfully retrieved.' - else - echo -e "\e[31mEccodes retrieval failed. Please check your Spack setup.\e[0m" - exit $1 - fi - - export GRIB_DEFINITION_PATH=${cosmo_eccodes}/cosmoDefinitions/definitions/:${eccodes}/share/eccodes/definitions/ - export OMPI_MCA_pml="ucx" - export OMPI_MCA_osc="ucx" - conda env config vars set GRIB_DEFINITION_PATH=${cosmo_eccodes}/cosmoDefinitions/definitions/:${eccodes}/share/eccodes/definitions/ -} - - -if [[ $(hostname -s) == *'tsa'* ]]; then - - check_python - source /project/g110/spack/user/admin-tsa/spack/share/spack/setup-env.sh - set_grib_definition_path - -elif [[ $(hostname -s) == *'daint'* ]]; then - - check_python - source /project/g110/spack/user/admin-daint/spack/share/spack/setup-env.sh - set_grib_definition_path - -elif [[ $(hostname -s) == *'balfrin'* ]]; then - - check_python - - if [[ -z $(command -v spack) ]]; then - echo -e "\e[31mSpack could not be found in your PATH.\e[0m" - echo -e "\e[31mBalfrin has no global system installation of Spack.\e[0m" - echo -e "\e[34mFollow the instructions below to install your own Spack instance:\e[0m" - echo -e "\e[34mhttps://github.com/C2SM/spack-c2sm/tree/dev_v0.18.1\e[0m" - echo -e "\e[34mThen install the latest eccodes and cosmo-eccodes with Spack before re-running this script:\e[0m" - echo -e "\e[34m$ spack install cosmo-eccodes-definitions@2.19.0.7 ^eccodes@2.19.0\e[0m" - exit $1 - fi - - set_grib_definition_path -fi - -# ---- required for fieldextra ------ - -if [[ $(hostname -s) == *'tsa'* ]]; then - - echo 'Setting FIELDEXTRA_PATH for tsa' - conda env config vars set FIELDEXTRA_PATH=/project/s83c/fieldextra/tsa/bin/fieldextra_gnu_opt_omp - -elif [[ $(hostname -s) == *'daint'* ]]; then - - echo 'Setting FIELDEXTRA_PATH for daint' - conda env config vars set FIELDEXTRA_PATH=/project/s83c/fieldextra/daint/bin/fieldextra_gnu_opt_omp - -elif [[ $(hostname -s) == *'balfrin'* ]]; then - - echo 'Setting FIELDEXTRA_PATH for balfrin' - conda env config vars set FIELDEXTRA_PATH=/users/oprusers/osm/bin/fieldextra -fi - -# ---- required for cartopy ------ - -if cp requirements/siteconfig.py $CONDA_PREFIX/lib/$python_lib/site-packages/cartopy; then - echo 'Cartopy configuration completed successfully.' -else - echo -e "\e[31mEnable cartopy to modify cartopy.config by placing the env/siteconfig.py file into cartopy package source folder.\n\e[0m"\ - "\e[31mPlease make sure that you are in the parent directory of the iconarray folder while executing this setup script.\e[0m" - exit $1 -fi - -echo -e "\n "\ - "Variables saved to environment: \n "\ - " " - -conda env config vars list - -echo -e "\n "\ - "\e[32mThe setup script completed successfully! \n \e[0m" \ - "\e[32mMake sure to deactivate your environment completely before reactivating it by running conda deactivate twice: \n \e[0m" \ - "\n "\ - "\e[32m conda deactivate \n \e[0m"\ - " " diff --git a/tools/setup_env.sh b/tools/setup_env.sh index 2826feb..003d52e 100755 --- a/tools/setup_env.sh +++ b/tools/setup_env.sh @@ -7,7 +7,7 @@ # # Default env names -DEFAULT_ENV_NAME="realtime-pollen-calibration" +DEFAULT_ENV_NAME="RTcalib" # Default options ENV_NAME="${DEFAULT_ENV_NAME}" @@ -66,3 +66,38 @@ else ${CONDA} env export --name ${ENV_NAME} --no-builds | \grep -v '^prefix:' > requirements/environment.yml || exit fi fi + + +# Cosmo eccodes definitions +definition_version="v2.25.0.2" +conda activate ${ENV_NAME} +conda_eccodes=${CONDA_PREFIX}/share/eccodes-cosmo-resources_${definition_version} +git clone -b ${definition_version} https://github.com/COSMO-ORG/eccodes-cosmo-resources.git ${conda_eccodes} || exit +${CONDA} env config vars set GRIB_DEFINITION_PATH=${conda_eccodes}/definitions/:${CONDA_PREFIX}/share/eccodes/definitions + + +# fieldextra path +echo 'Setting FIELDEXTRA_PATH for balfrin' +${CONDA} env config vars set FIELDEXTRA_PATH=/users/oprusers/osm/bin/fieldextra + + + +# # cartopy setup +# if [[ $(cp requirements/siteconfig.py $CONDA_PREFIX/lib/$python_lib/site-packages/cartopy) ]]; then +# echo 'Cartopy configuration completed successfully.' +# else +# echo -e "\e[31mEnable cartopy to modify cartopy.config by placing the env/siteconfig.py file into cartopy package source folder.\n\e[0m"\ +# "\e[31mPlease make sure that you are in the parent directory of the iconarray folder while executing this setup script.\e[0m" +# exit $1 +# fi + + +echo "Variables saved to environment: " +${CONDA} env config vars list + +echo -e "\n "\ + "\e[32mThe setup script completed successfully! \n \e[0m" \ + "\e[32mYou can activate you environment by running: \n \e[0m" \ + "\n "\ + "\e[32m conda activate ${ENV_NAME} \n \e[0m"\ + " "