source: trunk/LMDZ.COMMON/ioipsl/install_ioipsl_gfortran.bash @ 2253

Last change on this file since 2253 was 2075, checked in by aslmd, 6 years ago

set generic paths for arch and install_ioipsl for gfortran in LMDZ.COMMON

  • Property svn:executable set to *
File size: 1.8 KB
Line 
1#!/bin/bash
2# script to download and install the latest version of IOIPSL
3# using gfortran
4# You'll probably have to change paths to NetCDF library 'lib' and 'include'
5# below to adapt this script to your computer.
6
7#setfolder="/planeto/emlmd/netcdf64-4.0.1_gfortran4.4.7"
8#setfolder="/donnees/emlmd/netcdf64-4.0.1_gfortran/"
9setfolder=$NETCDF
10
11#0. Preliminary stuff
12# netcdf include and lib dirs:
13netcdf_include=$setfolder"/include"
14netcdf_lib=$setfolder"/lib"
15
16whereami=`pwd -P`
17
18# 1. Get IOIPSL (via modipsl)
19svn co http://forge.ipsl.jussieu.fr/igcmg/svn/modipsl/trunk modipsl
20cd modipsl/util
21
22# make all refs to ksh become refs to bash
23for i in ins_m_prec model script_diff_model script_log_analyse script_recup_model
24do
25  sed -e s:'#!/bin/ksh':'#!/bin/bash':1 $i > tmp
26  mv -f tmp $i
27done
28chmod u=rwx model
29chmod u=rwx ins_m_prec
30./model IOIPSL_PLUS
31
32# 2. Set correct settings:
33# modify path to netcdf in 'AA_make.gdef'
34cp AA_make.gdef AA_make.gdef.old
35sed -e s:"gfortran  NCDF_INC = /usr/local/include":"gfortran  NCDF_INC = ${netcdf_include}":1 \
36    -e s:"gfortran  NCDF_LIB = -L/usr/local/lib":"gfortran  NCDF_LIB = -L${netcdf_lib}":1 \
37    AA_make.gdef.old > AA_make.gdef
38
39# set default working precision for IOIPSL:
40./ins_make -t gfortran -p I4R8
41
42## 3. build ioipsl:
43cd ../modeles/IOIPSL/src
44# make all refs to ksh become refs to bash
45for i in AA_make.ldef Makefile
46do
47  sed -e s:'/bin/ksh':'/bin/bash':1 $i > tmp
48  mv -f tmp $i
49done
50make
51## Compile the rebuild tool:
52cd ../tools
53# make all refs to ksh become refs to bash
54for i in AA_make.ldef Makefile rebuild
55do
56  sed -e s:'/bin/ksh':'/bin/bash':1 $i > tmp
57  mv -f tmp $i
58done
59chmod u=rwx rebuild
60make
61
62if [[ -f ${whereami}/modipsl/lib/libioipsl.a ]] 
63  then
64  echo "OK: ioipsl library is in ${whereami}/modipsl/lib"
65else
66  echo "Something went wrong..."
67fi
68
Note: See TracBrowser for help on using the repository browser.