https://www.lmd.polytechnique.fr/chimere/docs/CHIMEREdoc_v2020r3.pdf
TODO: UNFORK this repository by doing (Since we are not using WRF implemented by NCAR) https://stackoverflow.com/questions/29326767/unfork-a-github-fork-without-deleting/41486339#41486339
The docker image is set in a Centos.7 OS. Chimere is ready to build using the gfortran compiler.
Chimere and its dependencies installed in the docker image are:
- Chimere https://www.lmd.polytechnique.fr/chimere/2020_getcode.php chimere_v2020r3.tar.gz
- GNU https://gcc.gnu.org/ GCC 4.7.2
- Open MPI https://www.open-mpi.org/software/ompi/ openmpi-2.0.4
- HDF5 https://support.hdfgroup.org/ftp/HDF5/releases/ HDF5 1.8.20
- Unidata NetCDF-C https://github.com/Unidata/netcdf-c/releases netCDF-C 4.6.0
- Unidata NetCDF-Fortran https://github.com/Unidata/netcdf-fortran/releases netCDF-Fortran 4.4.4
- Blitz https://sourceforge.net/projects/blitz blitz-0.10
- ecCodes https://confluence.ecmwf.int/display/ECC eccodes-2.19.1
- Jasper https://www.ece.uvic.ca/~frodo/jasper/#download JasPer 1.900.1
- Cmake https://github.com/Kitware/CMake/releases/download/v3.13.4/cmake-3.13.4.tar.gz cmake-3.13.4
docker --version
-
Set environment variables for Chimere credentials in order to download the Chimere resources.
export CHIMERE_USER=****
export CHIMERE_PASS=****
-
Get the docker image:
- Option 1: Get the chimere_conae image from docker hub (This is a public repository, https://hub.docker.com/repository/docker/lvc0107/chimere_conae,
but it's convenient for security reasons to store it in a private one, and change lvc0107 to conae_user).
docker pull lvc0107/chimere_conae:master
ordocker pull lvc0107/chimere_conae:v1.<build_number>
where <build_number> identify a specific build.mkdir -p CONAE_WRF_CHIMERE/INPUT
mkdir -p CONAE_WRF_CHIMERE/OUTPUT
- Option 2: Build the image from the source code.
git clone [email protected]:lvc0107/CONAE_WRF_CHIMERE.git
(SSH) orgit clone https://github.com/lvc0107/CONAE_WRF_CHIMERE.git
(HTTPS)cd CONAE_WRF_CHIMERE
DOCKER_BUILDKIT=1 docker build -t chimere_conae:<new_tag> --secret id=secret_user,env=CHIMERE_USER --secret id=secret_pass,env=CHIMERE_PASS .
where <new_tag> identify the latest change.- After running locally and checking all tests are ok, if there are any changes over any versioned file, it should be pushed to GitHub. (develop branch).This will trigger a GitHub action that creates a new docker image in the development environment. If the docker image is build successfully on the development branch, the next step is to rebase the development branch into the master branch via pull request process in Github. If the rebase process is successful, a new Github action is triggered in order to build and push the docker image to the docker hub registry with a master and v1.<build_number> tags.
- Option 1: Get the chimere_conae image from docker hub (This is a public repository, https://hub.docker.com/repository/docker/lvc0107/chimere_conae,
but it's convenient for security reasons to store it in a private one, and change lvc0107 to conae_user).
-
Download the emiSURF anthropogenic emissions pre-processor
- get emiSURF2020r4.tar.gz
wget --user $CHIMERE_USER --password $CHIMERE_PASS https://www.lmd.polytechnique.fr/chimdata/emisurf2020r4.tar.gz
tar -xvzf emisurf2020r4.tar.gz
rm emisurf2020r4.tar.gz
- get emiSURF2020r4.tar.gz
-
Download from Chimere page all the required DB.
cd CONAE_WRF_CHIMERE/INPUT
- get TestCase2020r3.tar.gz
wget --user $CHIMERE_USER --password $CHIMERE_PASS https://www.lmd.polytechnique.fr/chimdata/TestCase2020r3.tar.gz
tar -xvzf TestCase2020r3.tar.gz
rm TestCase2020r3.tar.gz
- get BIGFILES2020.tar.gz
wget --user $CHIMERE_USER --password $CHIMERE_PASS https://www.lmd.polytechnique.fr/chimdata/BIGFILES2020.tar.gz
tar -xvzf BIGFILES2020.tar.gz
rm BIGFILES2020.tar.gz
- get MEGAN_30s.tar.gz
wget --user $CHIMERE_USER --password $CHIMERE_PASS https://www.lmd.polytechnique.fr/chimdata/MEGAN_30s.tar.gz
tar -xvzf MEGAN_30s.tar.gz
rm MEGAN_30s.tar.gz
- get databases for emiSURF
wget --user $CHIMERE_USER --password $CHIMERE_PASS https://www.lmd.polytechnique.fr/chimdata/emisurf_data.tar.gz
tar -xvzf emisurf_data.tar.gz
rm emisurf_data.tar.gz
- get TestCase2020r3.tar.gz
-
Create chimere.par file. TODO COMPLETE
-
Create and enter the container:
cd CONAE_WRF_CHIMERE
docker run -v $(pwd)/INPUT/BIGFILES2020:/chim/chimere_v2020r3/...<TODO COMPLETE HERE path in Chimere>/ \ -v $(pwd)/OUTPUT:/chim/chimere_v2020r3/...<TODO COMPLETE HERE path in Chimere> \ -it --name chimere_container lvc0107/chimere_conae /bin/tcsh
You can verify that Chimere, WRF and WPS have been successfully compiled by doing the following:cat ./chimere_v2020r3/build_log*
.- If there are changes on the docker container we can create a new docker image from the updated container.
- TODO think how to keep these new changes in Github
exit
-
Run the model: TODO COMPLETE
docker start chimere_container
- Copy the chimere.par file from host into the container
cd CONAE_WRF_CHIMERE
docker cp chimere.par chimere_container:/chim/chimere_v2020r3/...TOOD COMPLETE this path /chimere.par
- Execute the run_simulation.sh script providing parameters
docker exec -it chimere_container sh -c "./chimere_v2020r3/run_simulation.sh firstdate=2013061500 lastdate=2013083100 incday=5 parfile=chimere.par"
- Get the results from the output_chimere folder.
- check Chimere in online mode.
- Check multiples instances of the container in the host.
- Docker compose or K8
- openmpi in the host in order to link multiples containers.