Difference between revisions of "Sample initialization script for GEOS-Chem"
From Geos-chem
(4 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
'''''[[Specifying settings for OpenMP parallelization|Previous]] | [[Downloading GEOS-Chem source code|Next]] | [[Getting Started with GEOS-Chem]]''''' | '''''[[Specifying settings for OpenMP parallelization|Previous]] | [[Downloading GEOS-Chem source code|Next]] | [[Getting Started with GEOS-Chem]]''''' | ||
#[[Minimum system requirements for GEOS-Chem|Minimum system requirements]] | #[[Minimum system requirements for GEOS-Chem|Minimum system requirements]] | ||
+ | #[[Installing required software]] | ||
#[[Configuring your computational environment]] | #[[Configuring your computational environment]] | ||
#*[[Specifying compilers for GEOS-Chem]] | #*[[Specifying compilers for GEOS-Chem]] | ||
Line 14: | Line 15: | ||
#[[Running GEOS-Chem|Running]] | #[[Running GEOS-Chem|Running]] | ||
#[[GEOS-Chem output files|Output files]] | #[[GEOS-Chem output files|Output files]] | ||
− | #[[ | + | #[[Python tools for use with GEOS-Chem]] |
#[[GEOS-Chem_coding_and_debugging|Coding and debugging]] | #[[GEOS-Chem_coding_and_debugging|Coding and debugging]] | ||
#[[GEOS-Chem_overview#Further_reading|Further reading]] | #[[GEOS-Chem_overview#Further_reading|Further reading]] | ||
Line 21: | Line 22: | ||
== Sample initialization script using Lmod modules == | == Sample initialization script using Lmod modules == | ||
− | This sample initialization script is based on an actual script used on the Harvard Cannon cluster. The script uses the Lmod module system to load the GNU Fortran compiler version 7.1 (which is part of the GNU Compiler Collection, or GCC). The script is named <tt>init.gc-classic.gfortran71.centos7</tt> and | + | This sample initialization script is based on an actual script used on the Harvard Cannon cluster. The script uses the Lmod module system to load the GNU Fortran compiler version 7.1 (which is part of the GNU Compiler Collection, or GCC). The script is named <tt>init.gc-classic.gfortran71.centos7</tt>, and it is invoked with: |
− | source init.gc-classic. | + | source init.gc-classic.gfortran71.centos7 |
− | The module load commands may be different on your system. | + | By default, this will set the <tt>OMP_NUM_THREADS</tt> to 1. If you wish to tell GEOS-Chem to run on e.g. 6 computational cores, you can type: |
+ | |||
+ | source init.gc-classic.gforgran71.centos7 6 | ||
+ | |||
+ | The module load commands in the script below may be different on your system. | ||
<nowiki> #============================================================================== | <nowiki> #============================================================================== | ||
Line 116: | Line 121: | ||
export NETCDF_HOME=`nc-config --prefix` | export NETCDF_HOME=`nc-config --prefix` | ||
fi | fi | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
fi</nowiki> | fi</nowiki> | ||
− | + | --[[User:Bmy|Bob Yantosca]] ([[User talk:Bmy|talk]]) 14:13, 2 December 2020 (UTC) | |
---- | ---- | ||
'''''[[Specifying settings for OpenMP parallelization|Previous]] | [[Downloading GEOS-Chem source code|Next]] | [[Getting Started with GEOS-Chem]]''''' | '''''[[Specifying settings for OpenMP parallelization|Previous]] | [[Downloading GEOS-Chem source code|Next]] | [[Getting Started with GEOS-Chem]]''''' |
Latest revision as of 21:28, 8 December 2020
Previous | Next | Getting Started with GEOS-Chem
- Minimum system requirements
- Installing required software
- Configuring your computational environment
- Specifying compilers for GEOS-Chem
- Specifying software libraries for GEOS-Chem
- Specifying parallelization settings
- A sample initialization script
- Downloading source code
- Downloading data directories
- Creating run directories
- Configuring runs
- Compiling
- Running
- Output files
- Python tools for use with GEOS-Chem
- Coding and debugging
- Further reading
Sample initialization script using Lmod modules
This sample initialization script is based on an actual script used on the Harvard Cannon cluster. The script uses the Lmod module system to load the GNU Fortran compiler version 7.1 (which is part of the GNU Compiler Collection, or GCC). The script is named init.gc-classic.gfortran71.centos7, and it is invoked with:
source init.gc-classic.gfortran71.centos7
By default, this will set the OMP_NUM_THREADS to 1. If you wish to tell GEOS-Chem to run on e.g. 6 computational cores, you can type:
source init.gc-classic.gforgran71.centos7 6
The module load commands in the script below may be different on your system.
#============================================================================== # %%%%% Clear existing environment variables %%%%% #============================================================================== unset PERL_HOME unset IDL_HOME unset EMACS_HOME unset CC unset CXX unset FC unset F77 unset F90 unset NETCDF_BIN unset NETCDF_HOME unset NETCDF_INCLUDE unset NETCDF_LIB unset NETCDF_FORTRAN_BIN unset NETCDF_FORTRAN_HOME unset NETCDF_FORTRAN_INCLUDE unset NETCDF_FORTRAN_LIB unset GC_BIN unset GC_INCLUDE unset GC_LIB unset GC_F_BIN unset GC_F_INCLUDE unset GC_F_LIB unset OMP_NUM_THREADS unset OMP_STACKSIZE #============================================================================== # %%%%% Load modules for GNU Fortran 7.1 %%%%% # # NOTE: Your module load commands may be different than these. # Ask your IT staff for more information. #============================================================================== echo "Loading modules for compiler gfortran71 ..." module purge module load git/2.17.0-fasrc01 module load perl/5.26.1-fasrc01 module load IDL/8.4.1-fasrc01 module load flex/2.6.4-fasrc01 module load gcc/7.1.0-fasrc01 module load openmpi/2.1.0-fasrc02 module load netcdf/4.3.2-fasrc05 module load netcdf-fortran/4.4.0-fasrc03 module load cdo/1.9.4-fasrc02 module load nco/4.7.4-fasrc01 module load ncview/2.1.7-fasrc02 module load emacs/26.1-fasrc01 module load cmake/3.12.1-fasrc01 module list # Define F90 and F77 environment variables (may be needed by some software) export F90=$FC export F77=$FC #============================================================================== # %%%%% Settings for OpenMP parallelization %%%%% #============================================================================== # Max out the stack memory for OpenMP # Asking for a huge number will just give you the max availble export OMP_STACKSIZE=500m # By default, set the number of threads for OpenMP parallelization to 1 export OMP_NUM_THREADS=1 # Redefine number threads for OpenMP parallelization # (a) If in a SLURM partition, set OMP_NUM_THREADS = SLURM_CPUS_PER_TASK # (b) Or, set OMP_NUM_THREADS to the optional first argument that is passed if [[ -n "${SLURM_CPUS_PER_TASK+1}" ]]; then export OMP_NUM_THREADS=$SLURM_CPUS_PER_TASK elif [[ "$#" -eq 1 ]]; then if [[ "x$1" != "xignoreeof" ]]; then export OMP_NUM_THREADS=$1 fi fi echo "Number of OpenMP threads: $OMP_NUM_THREADS" #============================================================================== # %%%%% Define relevant environment variables %%%%% #============================================================================== # Machine architecture export ARCH=`uname -s` # NETCDF_HOME if [[ "x$NETCDF_HOME" == x ]]; then export NETCDF_HOME=`nc-config --prefix` fi fi
--Bob Yantosca (talk) 14:13, 2 December 2020 (UTC)