source: trunk/LMDZ.MARS/util/compile @ 2817

Last change on this file since 2817 was 2817, checked in by abierjon, 2 years ago

Mars GCM:
Non-retrocompatible changes of the program util/aeroptical.F90 :

  • make the program more generic, as the user now specify in aeroptical.def the aerosols to be computed, as well as the necessary information for each aerosol, that are : aerosol_name,aerosol_mmr(GCM variable name),aerosol_reff(GCM variable name or single value in m),aerosol_rho(value in kg/m3),optpropfile_name
  • creation of a separate module aeropt_mod.F90 that can be used by other programs (e.g. for the MCD), with one subroutine reading the ASCII optical properties file, one subroutine interpolating optical properties at a given (wvl,reff) tuple, and one subroutine deallocating the module variables.
  • modify the compile program to compile this module aeropt_mod.F90 along with the aeroptical.F90 program. There is no change for the user, which just has to run the command 'compile aeroptical' like before.
  • correct the handling of user's wavelength or particle sizes that do not lie within the boundaries of the optical properties file.

AB

  • Property svn:executable set to *
File size: 2.6 KB
Line 
1# The following script can be used to compile one of the utilities
2# program. Example of use :
3# > compile concat
4# > compile zrecast
5## BUT first you must customize this script to your personal settings:
6# 1) set up the correct environment; e.g. environment variable
7#    NETCDF_HOME should point to your NetCDF distribution root directory
8#    (and possibly you might need to "module load ..." a few things)
9# 2) put the appropriate compiler and compiler options
10#    in variables COMPILER and COMPILER_OPTIONS
11# 3) Note that when you will run the executable, you might need to
12#    also add the paths to the used libraries (e.g. $NETCDF_HOME/lib)
13#    in environment variable LD_LIBRARY_PATH (most often the "module load ..."
14#    command does this, so you should run it before running the executable)
15
16# Setup: (see at the end of this script for real world examples)
17# possibly source some modules here and adapt variables below:
18NETCDF_HOME="/path/to/the/NetCDF/root/directory"
19COMPILER="gfortran"
20COMPILER_OPTIONS="-O2"
21
22# Compilation:
23# (on some very old systems the Fortran NetCDF library is included
24#  in the C library and "-lnetcdff" should be replaced with "-lnetcdf")
25
26code=$1.F90 # default
27# some programs need to compile external modules
28if [[ "$code" == aeroptical.F90 ]]
29then
30  code="aeropt_mod.F90 $code"
31fi
32
33$COMPILER $COMPILER_OPTIONS $code \
34-I$NETCDF_HOME/include \
35-L$NETCDF_HOME/lib -lnetcdff \
36-o $1.e
37
38#
39# Example of a setup on a simple Linux system where the netcdf library
40# is in a personal location /home/myacount/netcdf directory:
41# NETCDF_HOME=/home/myaccount/netcdf
42# COMPILER="gfortran"
43# COMPILER_OPTIONS="-O2"
44# And of course the LD_LIBRARY_PATH environement variable should contain
45# path "/home/myaccount/netcdf/lib" to be able to run the executable
46#
47# Example of a setup on LMD CentOS7 machines using gfortran and NetCDF 4.5:
48# module purge
49# module load gnu/7.2.0
50# module load netcdf4/4.5.0-gfortran72
51# NETCDF_HOME=/opt/netcdf45/gfortran72
52# COMPILER="gfortran"
53# COMPILER_OPTIONS="-O2"
54# And of course modules above need be loaded before running the executable
55#
56# Example of a setup on the Ciclad cluster using ifort and NetCDF 4.3
57# module purge
58# module load intel/15.0.6.233
59# module load netcdf4/4.3.3.1-ifort
60# NETCDF_HOME=/opt/netcdf43/ifort
61# COMPILER="ifort"
62# COMPILER_OPTIONS="-O2 -ip"
63# And of course modules above need be loaded before running the executable
64#
65# Example of a setup on the Occigen supercomputer
66# module purge
67# module load intel/17.0
68# module load intelmpi/2017.0.098
69# module load hdf5/1.8.17
70# module load netcdf/4.4.0_fortran-4.4.2
71# NETCDF_HOME=$NETCDFHOME
72# COMPILER="ifort"
73# COMPILER_OPTIONS="-O2 -ip"
74
75
Note: See TracBrowser for help on using the repository browser.