source: trunk/LMDZ.COMMON/ioipsl/install_ioipsl_MesoPSL.bash @ 2656

Last change on this file since 2656 was 2620, checked in by bclmd, 3 years ago

ioipsl install file for MesoPSL

  • Property svn:executable set to *
File size: 3.3 KB
Line 
1#!/bin/bash
2# script to download and install the latest version of IOIPSL
3# using ifort
4# You'll probably have to change path to NetCDF library
5# below to adapt this script to your computer.
6
7#0. Preliminary stuff
8if (( $# == 0 ))
9then
10  # default behavior: get latest version of IOIPSL
11  rev="HEAD"
12else
13  # but otherwise the first argument of the script can be the version to use
14  if (( $# == 1 ))
15  then
16    rev=$1
17  else
18    echo "Error, invalid script arguments"
19    echo "Usage:"
20    echo "$0 rev"
21    echo " where optional rev is the IOIPSL revision number"
22    exit
23  fi
24fi
25
26# Where is the NetCDF library root located? Hopefully nf-config can tell us
27# but you might need an appropriate "module load netcdf***" beforehand
28NETCDF_HOME=$(nf-config --prefix)
29
30# cleanup possible previous attempt:
31\rm -rf ../../IOIPSL modipsl
32
33# 1. Get IOIPSL
34# move up at same level as LMDZ.COMMON , etc.
35cd ../..
36svn co --revision $rev http://forge.ipsl.jussieu.fr/igcmg/svn/IOIPSL/trunk IOIPSL
37
38# 2. Set correct settings: make some arch.* files
39# Ideally these arch files should be the same as the GCM's
40# arch.env file (add any suitable module load here)
41cd IOIPSL/arch
42echo "" > arch-ifort.env
43echo "export NETCDF_HOME=$NETCDF_HOME" >> arch-ifort.env
44# arch.fcm file
45echo '%COMPILER            ifort' > arch-ifort.fcm
46echo '%LINK                ifort' >> arch-ifort.fcm
47echo '%AR                  ar' >> arch-ifort.fcm
48echo '%MAKE                make' >> arch-ifort.fcm
49echo '%FPP_FLAGS           -P -traditional' >> arch-ifort.fcm
50echo '%BASE_FFLAGS         -real-size 64 -ip -mkl=parallel -fp-model precise -align common' >> arch-ifort.fcm
51echo '%PROD_FFLAGS         -O3' >> arch-ifort.fcm
52echo '%DEV_FFLAGS          -O2' >> arch-ifort.fcm
53echo '%DEBUG_FFLAGS        -fpe0 -g -no-ftz -check -traceback -ftrapuv -fp-stack-check -O0' >> arch-ifort.fcm
54echo '%MPI_FFLAGS          ' >> arch-ifort.fcm
55echo '%OMP_FFLAGS          ' >> arch-ifort.fcm
56echo '%BASE_LD             ' >> arch-ifort.fcm
57echo '%MPI_LD              ' >> arch-ifort.fcm
58echo '%OMP_LD              ' >> arch-ifort.fcm
59# arch.path file
60#echo "NETCDF_INCDIR=\"-I$NETCDF_HOME/include\"" > arch-ifort.path
61#echo "NETCDF_LIBDIR=\"-L$NETCDF_HOME/lib\"" >> arch-ifort.path
62#echo 'NETCDF_LIB="-lnetcdff"' >> arch-ifort.path
63echo "NETCDF_LIBDIR=\"-L/obs/bcharnay/NETCDF_ifort/lib\"" > arch-ifort.path
64echo "NETCDF_INCDIR=\"-I/obs/bcharnay/NETCDF_ifort/include\"" >> arch-ifort.path
65echo 'NETCDF_LIB="-lnetcdf -lnetcdff"' >> arch-ifort.path
66
67echo '' >> arch-ifort.path
68echo 'HDF5_INCDIR=""' >> arch-ifort.path
69echo 'HDF5_LIBDIR=""' >> arch-ifort.path
70echo 'HDF5_LIB=""' >> arch-ifort.path
71echo '' >> arch-ifort.path
72echo 'MPI_INCDIR=""' >> arch-ifort.path
73echo 'MPI_LIBDIR=""' >> arch-ifort.path
74echo 'MPI_LIB=""' >> arch-ifort.path
75
76## 3. build ioipsl:
77cd ..
78./makeioipsl_fcm -arch ifort -job 8 > makeioipsl.out 2>&1
79
80## 4. Check if the library was indeed built:
81whereami=`pwd -P`
82if [[ -f lib/libioipsl.a ]] 
83  then
84  echo "OK: ioipsl library is in ${whereami}/lib"
85else
86  echo "Something went wrong... check messages in ${whereami}/makeioipsl.out"
87  exit
88fi
89
90## 5. Comply with old setup and make appropriate links
91cd ../LMDZ.COMMON/ioipsl
92mkdir modipsl
93cd modipsl
94# lib + module files
95mkdir lib
96cd lib
97ln -s ../../../../IOIPSL/lib/libioipsl.a .
98ln -s ../../../../IOIPSL/inc/* .
99cd ..
100# rebuild utility
101mkdir bin
102cd bin
103ln -s ../../../../IOIPSL/bin/* .
104
Note: See TracBrowser for help on using the repository browser.