source: dynamico_lmdz/aquaplanet/ICOSA_LMDZ/make_icosa_lmdz @ 3906

Last change on this file since 3906 was 3906, checked in by ymipsl, 9 years ago

Configuration DYNAMICO-LMDZ-ORCHIDEE is now compiling.

YM

  • Property svn:executable set to *
File size: 3.9 KB
Line 
1#!/bin/bash
2export PATH=$PWD/tools/FCM/bin:$PATH
3
4export ROOT=$PWD
5
6echo ./make_icosa $* > rebuild
7chmod a+x rebuild
8
9compil_mode_defined="FALSE"
10compil_mode="prod"
11
12job=1
13full_defined="FALSE"
14with_xios_defined="FALSE"
15with_orchidee_defined="FALSE"
16arch_defined="FALSE"
17parallel_defined="FALSE"
18arch_path="arch"
19parallel="none"
20physics="none"
21CPP_KEY="CPP_NONE" 
22ICOSA_LIB=""
23
24while (($# > 0))
25  do
26  case $1 in
27      "-h") cat <<fin
28Usage :
29makegcm [options] -m arch exec
30[-h]                       : help
31[-prod / -dev / -debug]    : compilation en mode production (default) / developpement / debug .
32 -arch nom_arch            : nom de l\'architecture cible
33fin
34          exit;;
35
36      "-prod")
37          compil_mode="prod" ; shift ;;
38
39      "-dev")
40          compil_mode="dev" ; shift ;;
41
42      "-debug")
43          compil_mode="debug" ; shift ;;
44
45      "-arch")
46          arch=$2 ; arch_defined="TRUE"; shift ; shift ;;
47 
48      "-arch_path")
49          arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;;
50
51      "-parallel")
52          parallel=$2 ; parallel_defined="TRUE"; shift ; shift ;;
53
54      "-job")
55          job=$2 ; shift ; shift;;
56
57      "-full")
58          full_defined="TRUE" ; shift ;;
59
60      "-with_xios")
61          with_xios_defined="TRUE" ; shift ;;
62
63      "-with_orchidee")
64          with_orchidee_defined="TRUE" ; shift ;;
65
66      *)
67          code="$1" ; shift ;;
68  esac
69done
70
71rm -f .void_file
72echo > .void_file
73rm -rf .void_dir
74mkdir .void_dir
75
76if [[ "$arch_defined" == "TRUE" ]]
77then
78  rm -f arch.path
79  rm -f arch.fcm
80  rm -f arch.env
81  ln -s $arch_path/arch-${arch}.path ./arch.path
82  ln -s $arch_path/arch-${arch}.fcm  ./arch.fcm
83  if test -f $arch_path/arch-${arch}.env
84    then
85      ln -s $arch_path/arch-${arch}.env arch.env
86    else
87      ln -s .void_file arch.env
88    fi
89  source arch.env
90  source arch.path
91else
92  echo "Veuillez definir une architecture cible"
93  exit 1
94fi
95
96LD_FLAGS="%BASE_LD"
97
98if [[ "$compil_mode" == "prod" ]]
99then
100  COMPIL_FFLAGS="%PROD_FFLAGS"
101elif [[ "$compil_mode" == "dev" ]]
102then
103  COMPIL_FFLAGS="%DEV_FFLAGS"
104elif [[ "$compil_mode" == "debug" ]]
105then
106  COMPIL_FFLAGS="%DEBUG_FFLAGS"
107fi
108
109if [[ "$parallel" == "mpi" ]]
110then
111  CPP_KEY="$CPP_KEY CPP_USING_MPI"
112elif [[ "$parallel" == "omp" ]]
113then
114  CPP_KEY="$CPP_KEY CPP_USING_OMP"
115  COMPIL_FFLAGS="$COMPIL_FFLAGS %OMP_FFLAGS"
116  LD_FLAGS="$LD_FLAGS %OMP_LD"
117elif [[ "$parallel" == "mpi_omp" ]]
118then
119  CPP_KEY="$CPP_KEY CPP_USING_MPI CPP_USING_OMP"
120  COMPIL_FFLAGS="$COMPIL_FFLAGS %OMP_FFLAGS"
121  LD_FLAGS="$LD_FLAGS %OMP_LD"
122elif [[ "$parallel" == "none" ]]
123then
124  parallel="none"
125else 
126  echo "-parallel value $parallel is invalid, only permited <none>, <mpi>, <omp> or <mpi_omp>"
127  exit 1
128fi
129
130if [[ "$with_orchidee_defined" == "TRUE" ]]
131then
132  ICOSA_LIB="$ICOSA_LIB $ORCHIDEE_LIBDIR $ORCHIDEE_LIB"
133fi 
134
135if [[ "$with_xios_defined" == "TRUE" ]]
136then
137  CPP_KEY="$CPP_KEY CPP_USING_XIOS"
138  COMPIL_FFLAGS="$COMPIL_FFLAGS $XIOS_INCDIR"
139  ICOSA_LIB="$ICOSA_LIB $XIOS_LIBDIR $XIOS_LIB"
140fi 
141
142ICOSA_LIB="$ICOSA_LIB $NETCDF_LIBDIR $NETCDF_LIB $HDF5_LIBDIR $HDF5_LIB"
143
144
145rm bin/*
146
147cd ../IOIPSL/src
148make
149
150cd -
151
152cd ../XIOS
153#make_xios --$compil_mode --arch $arch --job $job
154
155cd -
156
157if [[ "$full_defined" == "TRUE" ]]
158then
159  full_flag="-full"
160else 
161  full_flag=""
162fi
163
164if [[ "$with_orchidee_defined" == "TRUE" ]]
165then
166  cd ../ORCHIDEE
167  makeorchidee_fcm -$compil_mode -parallel $parallel -xios2 -arch $arch -j $job $full_flag
168fi
169cd -
170
171cd ../LMDZ5
172lmdz_veget="false"
173if [[ "$with_orchidee_defined" == "TRUE" ]]
174then
175  lmdz_veget="orchidee2.0"
176fi
177makelmdz_fcm toto -$compil_mode -mem -parallel $parallel -nodyn -io xios -v $lmdz_veget -arch $arch -j $job $full_flag
178
179cd -
180
181cd ../ICOSAGCM
182make_icosa -$compil_mode -parallel $parallel -external_ioipsl -with_xios -arch $arch -job $job $full_flag
183
184cd -
185
186rm -f config.fcm
187
188echo "%COMPIL_FFLAGS $COMPIL_FFLAGS $NETCDF_INCDIR" >> config.fcm
189echo "%LD_FLAGS $LD_FLAGS" >> config.fcm
190echo "%CPP_KEY $CPP_KEY" >> config.fcm
191echo "%LIB $ICOSA_LIB">> config.fcm
192
193if [[ "$full_defined" == "TRUE" ]]
194then
195  ./build --job $job --full
196else
197  ./build --job $job
198fi
Note: See TracBrowser for help on using the repository browser.