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 | $COMPILER $COMPILER_OPTIONS $1.F90 \ |
---|
27 | -I$NETCDF_HOME/include \ |
---|
28 | -L$NETCDF_HOME/lib -lnetcdff \ |
---|
29 | -o $1.e |
---|
30 | |
---|
31 | # |
---|
32 | # Example of a setup on a simple Linux system where the netcdf library |
---|
33 | # is in a personal location /home/myacount/netcdf directory: |
---|
34 | # NETCDF_HOME=/home/myaccount/netcdf |
---|
35 | # COMPILER="gfortran" |
---|
36 | # COMPILER_OPTIONS="-O2" |
---|
37 | # And of course the LD_LIBRARY_PATH environement variable should contain |
---|
38 | # path "/home/myaccount/netcdf/lib" to be able to run the executable |
---|
39 | # |
---|
40 | # Example of a setup on LMD CentOS7 machines using gfortran and NetCDF 4.5: |
---|
41 | # module purge |
---|
42 | # module load gnu/7.2.0 |
---|
43 | # module load netcdf4/4.5.0-gfortran72 |
---|
44 | # NETCDF_HOME=/opt/netcdf45/gfortran72 |
---|
45 | # COMPILER="gfortran" |
---|
46 | # COMPILER_OPTIONS="-O2" |
---|
47 | # And of course modules above need be loaded before running the executable |
---|
48 | # |
---|
49 | # Example of a setup on the Ciclad cluster using ifort and NetCDF 4.3 |
---|
50 | # module purge |
---|
51 | # module load intel/15.0.6.233 |
---|
52 | # module load netcdf4/4.3.3.1-ifort |
---|
53 | # NETCDF_HOME=/opt/netcdf43/ifort |
---|
54 | # COMPILER="ifort" |
---|
55 | # COMPILER_OPTIONS="-O2 -ip" |
---|
56 | # And of course modules above need be loaded before running the executable |
---|
57 | |
---|
58 | |
---|