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: |
---|
18 | #NETCDF_HOME="/path/to/the/NetCDF/root/directory" |
---|
19 | COMPILER="gfortran" |
---|
20 | COMPILER_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 | |
---|
26 | module purge |
---|
27 | module load intel/17.0 |
---|
28 | module load intelmpi/2017.0.098 |
---|
29 | module load hdf5/1.8.17 |
---|
30 | module load netcdf/4.4.0_fortran-4.4.2 |
---|
31 | NETCDF_HOME=$NETCDFHOME |
---|
32 | COMPILER="ifort" |
---|
33 | COMPILER_OPTIONS="-O2 -ip" |
---|
34 | |
---|
35 | |
---|
36 | $COMPILER $COMPILER_OPTIONS $1.F90 \ |
---|
37 | -I$NETCDF_HOME/include \ |
---|
38 | -L$NETCDF_HOME/lib -lnetcdff \ |
---|
39 | -o $1.e |
---|
40 | |
---|
41 | # |
---|
42 | # Example of a setup on a simple Linux system where the netcdf library |
---|
43 | # is in a personal location /home/myacount/netcdf directory: |
---|
44 | # NETCDF_HOME=/home/myaccount/netcdf |
---|
45 | # COMPILER="gfortran" |
---|
46 | # COMPILER_OPTIONS="-O2" |
---|
47 | # And of course the LD_LIBRARY_PATH environement variable should contain |
---|
48 | # path "/home/myaccount/netcdf/lib" to be able to run the executable |
---|
49 | # |
---|
50 | # Example of a setup on LMD CentOS7 machines using gfortran and NetCDF 4.5: |
---|
51 | # module purge |
---|
52 | # module load gnu/7.2.0 |
---|
53 | # module load netcdf4/4.5.0-gfortran72 |
---|
54 | # NETCDF_HOME=/opt/netcdf45/gfortran72 |
---|
55 | # COMPILER="gfortran" |
---|
56 | # COMPILER_OPTIONS="-O2" |
---|
57 | # And of course modules above need be loaded before running the executable |
---|
58 | # |
---|
59 | # Example of a setup on the Ciclad cluster using ifort and NetCDF 4.3 |
---|
60 | # module purge |
---|
61 | # module load intel/15.0.6.233 |
---|
62 | # module load netcdf4/4.3.3.1-ifort |
---|
63 | # NETCDF_HOME=/opt/netcdf43/ifort |
---|
64 | # COMPILER="ifort" |
---|
65 | # COMPILER_OPTIONS="-O2 -ip" |
---|
66 | # And of course modules above need be loaded before running the executable |
---|
67 | # |
---|
68 | # Example of a setup on the Occigen supercomputer |
---|
69 | # module purge |
---|
70 | # module load intel/17.0 |
---|
71 | # module load intelmpi/2017.0.098 |
---|
72 | # module load hdf5/1.8.17 |
---|
73 | # module load netcdf/4.4.0_fortran-4.4.2 |
---|
74 | # NETCDF_HOME=$NETCDFHOME |
---|
75 | # COMPILER="ifort" |
---|
76 | # COMPILER_OPTIONS="-O2 -ip" |
---|
77 | |
---|
78 | |
---|