GEOS GCM Quick Start: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
'''Back to [[Documentation for GEOS GCM v10]]''' | '''Back to [[Documentation for GEOS GCM v10]]''' | ||
= How to build GEOS GCM = | |||
== Preliminary Steps == | |||
=== | === Load Build Modules === | ||
In your <code>.bashrc</code> or <code>.tcshrc</code> or other rc file add a line: | |||
==== NCCS (SLES11) ==== | |||
module use -a /discover/swdev/gmao_SIteam/modulefiles-SLES11 | |||
==== NCCS (SLES12) ==== | |||
module use -a /discover/swdev/gmao_SIteam/modulefiles-SLES12 | |||
==== NAS ==== | |||
module use -a /nobackup/gmao_SIteam/modulefiles | |||
==== GMAO Desktops ==== | |||
On the GMAO desktops, the SI Team modulefiles should automatically be part of running <code>module avail</code> but if not, they are in: | |||
module use -a /ford1/share/gmao_SIteam/modulefiles | |||
This | Also do this in any interactive window you have. This allows you to get module files needed to correctly checkout and build the model. | ||
Now load the <code>GEOSenv</code> module: | |||
module load GEOSenv | |||
which obtains the latest <code>git</code>, <code>CMake</code>, and <code>manage_externals</code> modules. | |||
== Clone the Model == | |||
GEOS is now hosted on GitHub. | |||
git clone -b v10.12.4 git@github.com:GEOS-ESM/GEOSgcm.git | |||
== | == Building GEOS == | ||
=== Single Step Building of the Model === | |||
If all you wish is to build the model, you can run <code>parallel_build.csh</code> from a head node. Doing so will checkout all the external repositories of the model and build it. When done, the resulting model build will be found in <code>build/</code> and the installation will be found in <code>install/</code> with setup scripts like <code>gcm_setup</code> and <code>fvsetup</code> in <code>install/bin</code>. | |||
==== Develop Version of GEOS GCM ==== | |||
The user will notice two files in the main directory: <code>Externals.cfg</code> and <code>Develop.cfg</code>. The difference between these two is that <code>Externals.cfg</code> always refers to stable tested released subrepositories. The <code>Develop.cfg</code> points to the <code>develop</code> branch of <code>@GEOSgcm_GridComp</code> and <code>@GEOSgcm_App</code>. This is equivalent in the CVS days of the difference between a stable <code>Jason-X_Y</code> tag and the development <code>Jason-UNSTABLE</code> tag. In order to build the <code>Develop.cfg</code> version of the model with <code>parallel_build.csh</code> do: | |||
parallel_build.csh -develop | |||
=== | ==== Debug Version of GEOS GCM ==== | ||
To obtain a debug version, you can run <code>parallel_build.csh -debug</code> which will build with debugging flags. This will build in <code>build-Debug/</code> and install into <code>install-Debug/</code>. | |||
==== Mepo Version of GEOS GCM ==== | |||
GEOS GCM will soon be transitioning from using <code>checkout_externals</code> to using [https://github.com/GEOS-ESM/mepo <code>mepo</code>], a GMAO-developed multi-repository management tool. If you wish to use it via <code>parallel_build.csh</code> you can run: | |||
parallel_build.csh -mepo | |||
along with any other flags you usually use. | |||
=== Multiple Steps for Building the Model === | |||
The steps detailed below are essentially those that <code>parallel_build.csh</code> performs for you. Either method should yield identical builds. | |||
==== Checkout externals ==== | |||
Using the <code>checkout_externals</code> command to compose the model is done by: | |||
cd GEOSgcm | |||
checkout_externals | |||
====== Checking out develop ====== | |||
To use the <code>Develop.cfg</code> file, run: | |||
checkout_externals -e Develop.cfg | |||
== | ==== Mepo ==== | ||
=== Passwordless Logins | To checkout the full model with the [https://github.com/GEOS-ESM/mepo <code>mepo</code>] tool, you run: | ||
mepo init | |||
mepo clone | |||
The first command initializes the multi-repository and the second one clones and assembles all the sub-repositories according to <code>components.yaml</code> | |||
===== Checking out develop ===== | |||
To get development branches of GEOS GCM with <code>mepo</code> is different. <code>mepo</code> itself knows (via <code>components.yaml</code>) what the development branch of each subrepository is. The equivalent of <code>Develop.cfg</code> for <code>mepo</code> is to checkout the development branches of GEOSgcm_GridComp and GEOSgcm_App: | |||
mepo develop GEOSgcm_GridComp GEOSgcm_App | |||
This must be done after <code>mepo clone</code> as it is running a git command in each sub-repository. | |||
==== Build the Model ==== | |||
===== Load Compiler, MPI Stack, and Baselibs ===== | |||
On tcsh: | |||
<pre>source @env/g5_modules | |||
</pre> | |||
or on bash: | |||
<pre>source @env/g5_modules.sh | |||
</pre> | |||
===== Create Build Directory ===== | |||
We currently do not allow in-source builds of GEOSgcm. So we must make a directory: | |||
<pre>mkdir build | |||
</pre> | |||
The advantages of this is that you can build both a Debug and Release version with the same clone if desired. | |||
===== Run CMake ===== | |||
CMake generates the Makefiles needed to build the model. | |||
<pre>cd build | |||
cmake .. -DBASEDIR=$BASEDIR/Linux -DCMAKE_Fortran_COMPILER=ifort -DCMAKE_INSTALL_PREFIX=../install | |||
</pre> | |||
This will install to a directory parallel to your <code>build</code> directory. If you prefer to install elsewhere change the path in: | |||
-DCMAKE_INSTALL_PREFIX=<path> | |||
</pre> | |||
and CMake will install there. | |||
===== Build and Install with Make ===== | |||
<pre>make -j6 install | |||
</pre> | |||
= Running GEOS GCM = | |||
== Passwordless Logins == | |||
First of all, to run jobs on the cluster you will need to set up passwordless <code>ssh</code> (which operates within the cluster, between the nodes running the job). To do so, run the following from your '''discover''' home directory: | First of all, to run jobs on the cluster you will need to set up passwordless <code>ssh</code> (which operates within the cluster, between the nodes running the job). To do so, run the following from your '''discover''' home directory: | ||
Line 112: | Line 153: | ||
Then, log into '''dirac''' and cut and paste the contents of the <code>id_rsa.pub</code> file on '''discover''' into the <code>~/.ssh/authorized_keys</code> file on '''dirac'''. Problems with <code>ssh</code> should be referred to NCCS support. | Then, log into '''dirac''' and cut and paste the contents of the <code>id_rsa.pub</code> file on '''discover''' into the <code>~/.ssh/authorized_keys</code> file on '''dirac'''. Problems with <code>ssh</code> should be referred to NCCS support. | ||
=== DSA Keys === | |||
Note: Due to evolution of security, it is recommended to not use DSA keys. NAS currently doesn't not allow them, and RSA and ED25519 keys are considered "better" anyway. | Note: Due to evolution of security, it is recommended to not use DSA keys. NAS currently doesn't not allow them, and RSA and ED25519 keys are considered "better" anyway. | ||
== Setting up a model run == | |||
Once the model has built successfully, you will have an <code>install/</code> directory in your checkout. To run <code>gcm_setup</code> go to the <code>install/bin/</code> directory and run it there: | |||
cd install/bin | |||
./gcm_setup | ./gcm_setup | ||