Log In | Users | Register
COSMO Web

Build, Compile and run ICON from icon-2.6.0.0

This page describes the building and running of icon-2.6.0.0 (and later versions) from C2SM-ICON GitHub organization on the C2SM supported machines (Piz Daint at CSCS and Euler at ETHZ).

If you want to run an ICON version prior to icon-2.6.0.0, please go to this page.

History of this page

April 2020: Write the recipe for icon-2.6.0.0

Access to the code

To have access to the C2SM-ICON GitHub organization, please contact colombe.siegenthaler@env.ethz.ch.

Configure and compile ICON

This section gives a recipe for configuring and compiling ICON.

0) Set up the right environment

On daint.cscs.ch
Nothing to do.

1) Go in a suitable directory for compiling Go in a directory with a lot of space path_to_dir_with_lot_of_space

cd [path_to_dir_with_lot_of_space]

On daint.cscs.ch
To avoid inconsistency problem between login nodes and compute nodes, it is recommended to go on $SCRATCH (path_to_dir_with_lot_of_space is on $SCRATCH).
cd $SCRATCH

2) Clone C2SM ICON repository and go in your new local repository :

git clone git@github.com:C2SM-ICON/icon.git [foldername_local_repo_you_choose] 
cd [foldername_local_repo_you_choose]

If you want to use another branch or specific tag than the version in the master (for example use ICON-2.6.0.0), checkout the tag/branch you want:

git branch -a     # list the available branches
or
git tag -l        # list the available tags
git checkout [branch_or_tag_you_choose]

If you want to make developments, it is a good idea to create your own branch by adding the option -b to the checkout command:

git checkout [branch_or_tag_you_choose] -b [your_newbranch_name]     # create a new branch named 'your_newbranch_name'

The file README.md located in your local repository gives valuables information for building up the code. Please have a look at it. Below is a simple description how to get the code running in less than a snap of fingers (The same information is in the Section 'Quick start' of the README.md).

3) Configure using the compiler you want

Have a look on page listing the available Compiler Version for ICON related codes to know which compiler you can use, and which configuration file you need.

In the folder [foldername_local_repo_you_choose]/config/, there is one folder per machine ([machine_you_want_to_compute_on], can be cscs, euler, dkrz, etc), where all the configuration files related to this machine are located. TO configure the model, you have to call the configuration file directly.

 ./config/[machine_you_want_to_compute_on]/[configuration_filename]     

For example, if you are on daint, and want to compile with pgi and run on CPU, type : ./config/cscs/daint.cpu.pgi

4) Build (compile) the code:

 make -j8
The executable will be located here : [foldername_local_repo_you_choose]/bin

Remark

icon-2.6.X.Y offers the possibility to have different icon executables (for example with different compilers) compiled from the one working copy simultaneously. The section 'Out-of-source configuration (building)' in README.md file gives more information.

In summary, you can create a new directory before configuration (point 3), here [new_directory_for_executable], and configure and compile from this new directory :

mkdir [new_directory_for_executable]
cd [new_directory_for_executable]
[path_to_dir_with_lot_of_space]/[foldername_local_repo_you_choose]/config/[machine_you_want_to_compute_on]/[configuration_filename]
make -j8
The executable can be found in [new_directory_for_executable]/bin/

Run the AMIP case (Global, echam physics)

5) Modify the machine-independent running script located in the run directory (for example run/exp.atm_amip, or create a new one by copying run/exp.atm_amip into run/exp.my_exp). The latter script is not the running script, the running script "run/exp.my_exp.run" will be created by the command make_runscripts.

 cd run
 edit and adapt exp.atm_amip

For example : You can change the output frequency of the files to 1 month : checkpoint_interval="P1M", restart_interval="P1M", file_interval="P1M". For 6h output data in the file: output_interval="PT6H" The time format is following the ISO-8601 duration string standard, for more info about the time stamp format, please consult the document Namelist_overview.pdf located in the doc folder of your icon distribution.

6) Construct the runscript for your experiment using the command make_runscripts. The output is the running script run/exp.my_exp.run :

 cd ..
 ./make_runscripts -s my_exp
Note: The command make_runscripts uses the machine-independent setting file located in the run folder run/exp.my_exp (the one edited in point 5), and write a running script for the specific machine which includes machine-specific parts (for example paths to input files, or the right call to batch system). The command make_runscripts calls the functions in run/create_target_header to write the machine-specific parts of the runscript.

7) Adjust your runscript

 cd run
 edit exp.my_exp.run, in particular, watch the #SBATCH header for account number (for daint.cscs.ch #SBATCH --account=XX ) or partition used.

If you want to use more than one node, change both #SBATCH --nodes=XX and the variable no_of_nodes in the runscript.

If you want to change the machine-specific settings more permanently to use the same number of nodes or same account for every runscript you create, you can modify run/create_target_header (for changing number of node, change the variable use_nodes).

8) submit the job

On daint.cscs.ch
sbatch --time=01:30:00 exp.my_exp.run 

Varia:

* The Cray computer used by DWD is similar to Piz Daint (but without GPU)

* At the demo in october 2017, it was the fisrt time that Will did not need to cross compile. In case a cross-compilation is needed, the configuration command should be the following (please check):

./configure --with-fortran=cray --build=x86_64-cray-linux  --host=x86_64-unknown-linux-gnu

* For access to buildbot (buildbot.zmaw.de/icon/waterfall), you should ask Luis or Reinhard. --> spacer

This site is managed by the Center for Climate Systems Modeling (C2SM).
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems? Send feedback!