source: trunk/LMDZ.COMMON/ioipsl/install_ioipsl_darwin.bash @ 2302

Last change on this file since 2302 was 2148, checked in by emillour, 6 years ago

Common dynamical core:

  • Add a script to install IOIPSL on Mac

EM+MW

  • Property svn:executable set to *
File size: 2.5 KB
Line 
1#!/bin/bash -x
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="/cm/shared/apps/netcdf/gcc/64/4.1.1"
8#setfolder="/donnees/emlmd/netcdf64-4.0.1_gfortran/"
9setfolder="/usr/local/netcdf-4.0.1/"
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
20export MAKE=make
21cd modipsl/util
22
23./model IOIPSL_PLUS
24
25# 2. Set correct settings:
26# Add a Darwin case in 'AA_make.gdef'
27
28echo '#-Q- Darwin  #- Global definitions for gfortran on a Mac' >> AA_make.gdef
29echo '#-Q- Darwin  M_K = make' >> AA_make.gdef
30echo '#-Q- Darwin  P_C = cpp' >> AA_make.gdef
31echo '#-Q- Darwin  P_O = -P -C -traditional $(P_P)' >> AA_make.gdef
32echo '#-Q- Darwin  F_C = gfortran -c -cpp' >> AA_make.gdef
33echo '#-Q- Darwin  #-D- MD    F_D = -g -Wall -fbounds-check -pedantic -finit-real=nan' >> AA_make.gdef
34echo '#-Q- Darwin  #-D- MN    F_D =' >> AA_make.gdef
35echo '#-Q- Darwin  #-P- I4R4  F_P =' >> AA_make.gdef
36echo '#-Q- Darwin  #-P- I4R8  F_P = -fdefault-real-8' >> AA_make.gdef
37echo '#-Q- Darwin  #-P- I8R8  F_P = -fdefault-integer-8 -fdefault-real-8' >> AA_make.gdef
38echo '#-Q- Darwin  w_w = -O3 -funroll-all-loops $(F_D) $(F_P) -I$(MODDIR)' >> AA_make.gdef
39echo '#-Q- Darwin  F_O = $(w_w) -J$(MODDIR)' >> AA_make.gdef
40echo '#-Q- Darwin  F_L = gfortran' >> AA_make.gdef
41echo '#-Q- Darwin  M_M = 0' >> AA_make.gdef
42echo '#-Q- Darwin  L_X = 0' >> AA_make.gdef
43echo '#-Q- Darwin  L_O =' >> AA_make.gdef
44echo '#-Q- Darwin  A_C = ar -rs' >> AA_make.gdef
45echo '#-Q- Darwin  A_G = ar -x' >> AA_make.gdef
46echo '#-Q- Darwin  C_C = cc -c' >> AA_make.gdef
47echo '#-Q- Darwin  C_O =' >> AA_make.gdef
48echo '#-Q- Darwin  C_L = cc' >> AA_make.gdef
49echo '#-Q- Darwin  #-' >> AA_make.gdef
50echo "#-Q- Darwin  NCDF_INC = ${netcdf_include}" >> AA_make.gdef
51echo "#-Q- Darwin  NCDF_LIB = -L${netcdf_lib} -lnetcdf -lnetcdff" >> AA_make.gdef
52echo '#-Q- Darwin  #-' >> AA_make.gdef
53
54# set default working precision for IOIPSL:
55./ins_make -t Darwin -p I4R8
56
57## 3. build ioipsl:
58cd ../modeles/IOIPSL/src
59make
60## Compile the rebuild tool:
61cd ../tools
62make
63
64if [[ -f ${whereami}/modipsl/lib/libioipsl.a ]] 
65  then
66  echo "OK: ioipsl library is in ${whereami}/modipsl/lib"
67else
68  echo "Something went wrong..."
69fi
70
Note: See TracBrowser for help on using the repository browser.