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

Last change on this file since 3308 was 2666, checked in by aslmd, 3 years ago

modified the install_ioipsl script for MesoPSL with new arch

  • Property svn:executable set to *
File size: 3.6 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
25source ../../ARCH/arch-MesoPSL.env
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 --username icmc_users --password icmc2022 --non-interactive --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
42# echo "" > arch-ifort.env
43# echo "export NETCDF_HOME=$NETCDF_HOME" >> arch-ifort.env
44# # arch.fcm file
45# echo '%COMPILER            ifort' > arch-ifort.fcm
46# echo '%LINK                ifort' >> arch-ifort.fcm
47# echo '%AR                  ar' >> arch-ifort.fcm
48# echo '%MAKE                make' >> arch-ifort.fcm
49# echo '%FPP_FLAGS           -P -traditional' >> arch-ifort.fcm
50# echo '%BASE_FFLAGS         -real-size 64 -ip -mkl=parallel -fp-model precise -align common' >> arch-ifort.fcm
51# echo '%PROD_FFLAGS         -O3' >> arch-ifort.fcm
52# echo '%DEV_FFLAGS          -O2' >> arch-ifort.fcm
53# echo '%DEBUG_FFLAGS        -fpe0 -g -no-ftz -check -traceback -ftrapuv -fp-stack-check -O0' >> arch-ifort.fcm
54# echo '%MPI_FFLAGS          ' >> arch-ifort.fcm
55# echo '%OMP_FFLAGS          ' >> arch-ifort.fcm
56# echo '%BASE_LD             ' >> arch-ifort.fcm
57# echo '%MPI_LD              ' >> arch-ifort.fcm
58# echo '%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
63# echo "NETCDF_LIBDIR=\"-L/obs/bcharnay/NETCDF_ifort/lib\"" > arch-ifort.path
64# echo "NETCDF_INCDIR=\"-I/obs/bcharnay/NETCDF_ifort/include\"" >> arch-ifort.path
65# echo 'NETCDF_LIB="-lnetcdf -lnetcdff"' >> arch-ifort.path
66
67# echo '' >> arch-ifort.path
68# echo 'HDF5_INCDIR=""' >> arch-ifort.path
69# echo 'HDF5_LIBDIR=""' >> arch-ifort.path
70# echo 'HDF5_LIB=""' >> arch-ifort.path
71# echo '' >> arch-ifort.path
72# echo 'MPI_INCDIR=""' >> arch-ifort.path
73# echo 'MPI_LIBDIR=""' >> arch-ifort.path
74# echo 'MPI_LIB=""' >> arch-ifort.path
75cp ../../ARCH/arch-MesoPSL.env .
76cp ../../ARCH/arch-MesoPSL.path .
77cp ../../LMDZ.COMMON/arch/arch-MesoPSL.fcm .
78
79## 3. build ioipsl:
80cd ..
81./makeioipsl_fcm -arch MesoPSL -job 8 > makeioipsl.out 2>&1
82
83## 4. Check if the library was indeed built:
84whereami=`pwd -P`
85if [[ -f lib/libioipsl.a ]] 
86  then
87  echo "OK: ioipsl library is in ${whereami}/lib"
88else
89  echo "Something went wrong... check messages in ${whereami}/makeioipsl.out"
90  exit
91fi
92
93## 5. Comply with old setup and make appropriate links
94cd ../LMDZ.COMMON/ioipsl
95mkdir modipsl
96cd modipsl
97# lib + module files
98mkdir lib
99cd lib
100ln -s ../../../../IOIPSL/lib/libioipsl.a .
101ln -s ../../../../IOIPSL/inc/* .
102cd ..
103# rebuild utility
104mkdir bin
105cd bin
106ln -s ../../../../IOIPSL/bin/* .
107
Note: See TracBrowser for help on using the repository browser.