[1463] | 1 | #!/bin/bash |
---|
| 2 | # |
---|
[1695] | 3 | # $Id$ |
---|
[1463] | 4 | # |
---|
| 5 | # |
---|
| 6 | ######################################################################## |
---|
| 7 | # for debug, uncomment line below |
---|
| 8 | #set -xv |
---|
| 9 | ######################################################################## |
---|
| 10 | # options par defaut pour la commande make |
---|
| 11 | ######################################################################## |
---|
| 12 | dim="96x72x19" |
---|
| 13 | physique=lmd |
---|
| 14 | code=gcm |
---|
| 15 | filtre=filtrez |
---|
| 16 | grille=reg |
---|
| 17 | couple=false |
---|
| 18 | veget=false |
---|
| 19 | chimie=false |
---|
| 20 | parallel=none |
---|
[3997] | 21 | paramem="mem" |
---|
[1463] | 22 | compil_mod=prod |
---|
| 23 | io=ioipsl |
---|
| 24 | LIBPREFIX="" |
---|
| 25 | fcm_path=none |
---|
| 26 | cosp=false |
---|
[3359] | 27 | cosp2=false |
---|
[3491] | 28 | cospv2=false |
---|
[3793] | 29 | inlandsis=false |
---|
[1990] | 30 | rrtm=false |
---|
[3908] | 31 | rad="" |
---|
[2631] | 32 | dust=false |
---|
[2690] | 33 | strataer=false |
---|
[2112] | 34 | full="" |
---|
[1463] | 35 | |
---|
[2743] | 36 | arch_defined="FALSE" |
---|
| 37 | arch_path="arch" |
---|
| 38 | arch_default_path="arch" |
---|
| 39 | |
---|
[1463] | 40 | # guess a default 'arch' |
---|
[1690] | 41 | arch="local" # start with assuming we're on a local machine with local arch file |
---|
[2746] | 42 | arch_defined="TRUE" # and thus also set arch_defined to true |
---|
[1463] | 43 | ## try to recognise machine and infer arch from it |
---|
| 44 | machine=`hostname` |
---|
[3574] | 45 | if [[ "${machine:0:4}" == "jean" ]] |
---|
[1463] | 46 | then |
---|
[3574] | 47 | arch="X64_JEANZAY" |
---|
[1463] | 48 | fi |
---|
| 49 | if [[ "${machine:0:7}" == "platine" ]] |
---|
| 50 | then |
---|
| 51 | arch="IA64_PLATINE" |
---|
| 52 | fi |
---|
| 53 | if [[ "${machine:0:6}" == "titane" ]] |
---|
| 54 | then |
---|
| 55 | arch="X64_TITANE" |
---|
| 56 | fi |
---|
| 57 | if [[ "${machine:0:8}" == "mercure1" ]] |
---|
| 58 | then |
---|
| 59 | arch="SX8_MERCURE" |
---|
| 60 | fi |
---|
| 61 | if [[ "${machine:0:8}" == "mercure2" ]] |
---|
| 62 | then |
---|
| 63 | arch="SX9_MERCURE" |
---|
| 64 | fi |
---|
| 65 | |
---|
| 66 | LMDGCM=`pwd -P` |
---|
| 67 | LIBFGCM=$LMDGCM/libf |
---|
| 68 | LIBOGCM=$LMDGCM/libo |
---|
| 69 | if [[ ! -d $LIBOGCM ]] |
---|
| 70 | then |
---|
| 71 | # create the directory |
---|
| 72 | mkdir $LIBOGCM |
---|
| 73 | if [[ ! $? ]] |
---|
| 74 | then |
---|
| 75 | echo "Failed to create directory $LIBOGCM" |
---|
| 76 | exit |
---|
| 77 | fi |
---|
| 78 | fi |
---|
[3232] | 79 | #COSP_PATH=$LMDGCM/.void_dir |
---|
[1463] | 80 | |
---|
| 81 | |
---|
| 82 | |
---|
| 83 | localdir=`pwd -P` |
---|
| 84 | ######################################################################## |
---|
| 85 | # Quelques initialisations de variables du shell. |
---|
| 86 | ######################################################################## |
---|
| 87 | |
---|
[3835] | 88 | CPP_KEY="IN_LMDZ" |
---|
[2239] | 89 | INCLUDE='-I$(LIBF)/grid -I$(LIBF)/misc -I$(LIBF)/filtrez -I. ' |
---|
[1463] | 90 | LIB="" |
---|
| 91 | adjnt="" |
---|
| 92 | ##COMPIL_FFLAGS="%PROD_FFLAGS" |
---|
| 93 | PARA_FFLAGS="" |
---|
| 94 | PARA_LD="" |
---|
| 95 | EXT_SRC="" |
---|
[2238] | 96 | #src_dirs: directories containing source files |
---|
[4179] | 97 | src_dirs="grid misc" |
---|
[1463] | 98 | ######################################################################## |
---|
| 99 | # lecture des options |
---|
| 100 | ######################################################################## |
---|
| 101 | |
---|
| 102 | while (($# > 0)) |
---|
| 103 | do |
---|
| 104 | case $1 in |
---|
| 105 | "-h") cat <<fin |
---|
| 106 | Usage : |
---|
[1772] | 107 | makelmdz [options] -arch nom_arch exec |
---|
| 108 | [-h] : brief help |
---|
| 109 | [-d [[IMx]JMx]LM] : IM, JM, LM are the dimensions in x, y, z (default: $dim) |
---|
| 110 | [-p PHYS] : set of physical parametrizations (in libf/phyPHYS), (default: lmd) |
---|
| 111 | [-prod / -dev / -debug] : compilation mode production (default) / developement / debug |
---|
| 112 | [-c false/MPI1/MPI2] : coupling with ocean model : MPI1/MPI2/false (default: false) |
---|
| 113 | [-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false) |
---|
| 114 | false : no vegetation model |
---|
[3435] | 115 | orchidee2.1 : compile using ORCHIDEE 2.1 (or more recent version) |
---|
[1772] | 116 | orchidee2.0 : compile using ORCHIDEE 2.0 (or more recent version) |
---|
| 117 | orchidee1.9 : compile using ORCHIDEE up to the version including OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6 |
---|
| 118 | true : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6 |
---|
| 119 | [-chimie INCA/false] : with INCA chemistry model or without (default: false) |
---|
[2238] | 120 | [-cosp true/false] : compile with/without cosp package (default: false) |
---|
[3359] | 121 | [-cosp2 true/false] : compile with/without cosp2 package (default: false) |
---|
[3491] | 122 | [-cospv2 true/false] : compile with/without cospv2 package (default: false) |
---|
[3793] | 123 | [-inlandsis true/false] : compile with/without inlandsis package (default: false) |
---|
[2238] | 124 | [-rrtm true/false] : compile with/without rrtm package (default: false) |
---|
[3908] | 125 | [-rad old/rrtm/ecrad] : compile with old/rrtm/ecrad radiatif code (default: old) |
---|
[2631] | 126 | [-dust true/false] : compile with/without the dust package from Boucher et al. (default: false) |
---|
[2690] | 127 | [-strataer true/false] : compile with/without the strat aer package from Boucher et al. (default: false) |
---|
[1772] | 128 | [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp |
---|
| 129 | [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) |
---|
[2097] | 130 | [-io ioipsl/mix/xios] : Input/Output library (default: ioipsl) |
---|
[1772] | 131 | [-include INCLUDES] : extra include path to add |
---|
| 132 | [-cpp CPP_KEY] : additional preprocessing definitions |
---|
| 133 | [-adjnt] : adjoint model, not operational ... |
---|
[3997] | 134 | [-mem] : reduced memory dynamics (obsolete flag; always on in parallel mode) |
---|
[1772] | 135 | [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) |
---|
[2112] | 136 | [-full] : Full (re)compilation (from scratch) |
---|
[1772] | 137 | [-link LINKS] : additional links with other libraries |
---|
| 138 | [-fcm_path path] : path to the fcm tool (default: tools/fcm/bin) |
---|
| 139 | [-ext_src path] : path to an additional set of routines to compile with the model |
---|
[2743] | 140 | [-arch_path path] : path to architecture files (default: $arch_default_path) |
---|
[1772] | 141 | -arch nom_arch : target architecture |
---|
| 142 | exec : executable to build |
---|
[1463] | 143 | fin |
---|
| 144 | exit;; |
---|
| 145 | "-d") |
---|
| 146 | dim=$2 ; shift ; shift ;; |
---|
| 147 | |
---|
| 148 | "-p") |
---|
| 149 | physique="$2" ; shift ; shift ;; |
---|
| 150 | |
---|
| 151 | "-g") |
---|
| 152 | grille="$2" ; shift ; shift ;; |
---|
| 153 | |
---|
| 154 | "-c") |
---|
| 155 | couple="$2" ; shift ; shift ;; |
---|
| 156 | |
---|
| 157 | "-prod") |
---|
| 158 | compil_mod="prod" ; shift ;; |
---|
| 159 | |
---|
| 160 | "-dev") |
---|
| 161 | compil_mod="dev" ; shift ;; |
---|
| 162 | |
---|
| 163 | "-debug") |
---|
| 164 | compil_mod="debug" ; shift ;; |
---|
| 165 | |
---|
| 166 | "-io") |
---|
| 167 | io="$2" ; shift ; shift ;; |
---|
| 168 | |
---|
| 169 | "-v") |
---|
| 170 | veget="$2" ; shift ; shift ;; |
---|
| 171 | |
---|
| 172 | "-chimie") |
---|
| 173 | chimie="$2" ; shift ; shift ;; |
---|
| 174 | |
---|
| 175 | "-parallel") |
---|
| 176 | parallel="$2" ; shift ; shift ;; |
---|
| 177 | |
---|
| 178 | "-include") |
---|
| 179 | INCLUDE="$INCLUDE -I$2" ; shift ; shift ;; |
---|
| 180 | |
---|
| 181 | "-cpp") |
---|
| 182 | CPP_KEY="$CPP_KEY $2" ; shift ; shift ;; |
---|
| 183 | |
---|
| 184 | "-cosp") |
---|
| 185 | cosp="$2" ; shift ; shift ;; |
---|
[3359] | 186 | |
---|
| 187 | "-cosp2") |
---|
| 188 | cosp2="$2" ; shift ; shift ;; |
---|
[3491] | 189 | |
---|
| 190 | "-cosp2") |
---|
| 191 | cospv2="$2" ; shift ; shift ;; |
---|
[1690] | 192 | |
---|
[3793] | 193 | "-inlandsis") |
---|
| 194 | inlandsis="$2" ; shift ; shift ;; |
---|
| 195 | |
---|
[1990] | 196 | "-rrtm") |
---|
[3908] | 197 | rrtm="$2" ; if [ "$2" = "false" ] ; then rad="old" ; else rad="rrtm" ; fi ; shift ; shift ;; |
---|
[2631] | 198 | |
---|
[3908] | 199 | "-rad") |
---|
| 200 | rad="$2" ; shift ; shift ;; |
---|
| 201 | |
---|
[2631] | 202 | "-dust") |
---|
| 203 | dust="$2" ; shift ; shift ;; |
---|
[1990] | 204 | |
---|
[2690] | 205 | "-strataer") |
---|
| 206 | strataer="$2" ; shift ; shift ;; |
---|
| 207 | |
---|
[1690] | 208 | "-mem") |
---|
[3997] | 209 | echo "option -mem is obsolete (now always on in parallel)" |
---|
[1690] | 210 | paramem="mem" ; shift ;; |
---|
[1463] | 211 | |
---|
| 212 | "-filtre") |
---|
| 213 | filtre=$2 ; shift ; shift ;; |
---|
| 214 | |
---|
[2112] | 215 | "-full") |
---|
| 216 | full="full" ; shift ;; |
---|
| 217 | |
---|
[1463] | 218 | "-link") |
---|
| 219 | LIB="$LIB $2" ; shift ; shift ;; |
---|
| 220 | |
---|
| 221 | "-fcm_path") |
---|
| 222 | fcm_path=$2 ; shift ; shift ;; |
---|
| 223 | |
---|
| 224 | "-ext_src") |
---|
[2238] | 225 | EXT_SRC=$2 ; src_dirs="$src_dirs $EXT_SRC" ; shift ; shift ;; |
---|
[1463] | 226 | |
---|
| 227 | "-arch") |
---|
[2743] | 228 | arch=$2 ; arch_defined="TRUE" ; shift ; shift ;; |
---|
[1463] | 229 | |
---|
[2743] | 230 | "-arch_path") |
---|
| 231 | arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;; |
---|
| 232 | |
---|
[1463] | 233 | *) |
---|
| 234 | code="$1" ; shift ;; |
---|
| 235 | esac |
---|
| 236 | done |
---|
| 237 | |
---|
| 238 | ############################################################### |
---|
[2098] | 239 | # lecture des chemins propres \`a l'architecture de la machine # |
---|
[1463] | 240 | ############################################################### |
---|
| 241 | rm -f .void_file |
---|
| 242 | echo > .void_file |
---|
| 243 | rm -rf .void_dir |
---|
| 244 | mkdir .void_dir |
---|
[2743] | 245 | |
---|
| 246 | if [[ "$arch_defined" == "TRUE" ]] |
---|
[1463] | 247 | then |
---|
[2743] | 248 | rm -f arch.path |
---|
| 249 | rm -f arch.fcm |
---|
| 250 | rm -f arch.env |
---|
| 251 | |
---|
| 252 | if test -f $arch_path/arch-${arch}.path |
---|
| 253 | then |
---|
| 254 | ln -s $arch_path/arch-${arch}.path arch.path |
---|
| 255 | elif test -f $arch_default_path/arch-${arch}.path |
---|
| 256 | then |
---|
| 257 | ln -s $arch_default_path/arch-${arch}.path arch.path |
---|
| 258 | fi |
---|
| 259 | |
---|
| 260 | if test -f $arch_path/arch-${arch}.fcm |
---|
| 261 | then |
---|
| 262 | ln -s $arch_path/arch-${arch}.fcm arch.fcm |
---|
| 263 | elif test -f $arch_default_path/arch-${arch}.fcm |
---|
| 264 | then |
---|
| 265 | ln -s $arch_default_path/arch-${arch}.fcm arch.fcm |
---|
| 266 | fi |
---|
| 267 | |
---|
| 268 | if test -f $arch_path/arch-${arch}.env |
---|
| 269 | then |
---|
| 270 | ln -s $arch_path/arch-${arch}.env arch.env |
---|
| 271 | elif test -f $arch_default_path/arch-${arch}.env |
---|
| 272 | then |
---|
| 273 | ln -s $arch_default_path/arch-${arch}.env arch.env |
---|
| 274 | else |
---|
| 275 | ln -s .void_file arch.env |
---|
| 276 | fi |
---|
| 277 | # source architecture PATH and ENV files |
---|
| 278 | source arch.env |
---|
[1463] | 279 | source arch.path |
---|
| 280 | else |
---|
[2743] | 281 | echo "You must define a target architecture" |
---|
| 282 | exit 1 |
---|
[1463] | 283 | fi |
---|
[2743] | 284 | |
---|
[1463] | 285 | ######################################################################## |
---|
| 286 | # Definition des clefs CPP, des chemins des includes et modules |
---|
| 287 | # et des libraries |
---|
| 288 | ######################################################################## |
---|
| 289 | |
---|
| 290 | # basic compile flags from arch.fcm file |
---|
| 291 | archfileline=$( grep -i '^%BASE_FFLAGS' arch.fcm ) |
---|
| 292 | COMPIL_FFLAGS=$( echo ${archfileline##%BASE_FFLAGS} ) |
---|
| 293 | |
---|
| 294 | # other compile flags, depending on compilation mode |
---|
| 295 | if [[ "$compil_mod" == "prod" ]] |
---|
| 296 | then |
---|
| 297 | ## read COMPIL_FFLAGS from arch.fcm file |
---|
| 298 | archfileline=$( grep -i '^%PROD_FFLAGS' arch.fcm ) |
---|
| 299 | archfileopt=$( echo ${archfileline##%PROD_FFLAGS} ) |
---|
| 300 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
---|
| 301 | elif [[ "$compil_mod" == "dev" ]] |
---|
| 302 | then |
---|
| 303 | ## read %DEV_FFLAGS from arch.fcm file |
---|
| 304 | archfileline=$( grep -i '^%DEV_FFLAGS' arch.fcm ) |
---|
| 305 | archfileopt=$( echo ${archfileline##%DEV_FFLAGS} ) |
---|
| 306 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
---|
| 307 | elif [[ "$compil_mod" == "debug" ]] |
---|
| 308 | then |
---|
| 309 | ## read %DEBUG_FFLAGS from arch.fcm file |
---|
| 310 | archfileline=$( grep -i '^%DEBUG_FFLAGS' arch.fcm ) |
---|
| 311 | archfileopt=$( echo ${archfileline##%DEBUG_FFLAGS} ) |
---|
| 312 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
---|
| 313 | fi |
---|
| 314 | |
---|
| 315 | # add CPP_KEY defined in arch.fcm file |
---|
| 316 | archfileline=$( grep -i '^%FPP_DEF' arch.fcm ) |
---|
| 317 | archfileopt=$( echo ${archfileline##%FPP_DEF} ) |
---|
| 318 | CPP_KEY="$CPP_KEY ${archfileopt}" |
---|
| 319 | |
---|
| 320 | # get compiler name from arch.fcm file |
---|
| 321 | archfileline=$( grep -i '^%COMPILER' arch.fcm ) |
---|
| 322 | fcompiler=$( echo ${archfileline##%COMPILER} ) |
---|
| 323 | |
---|
| 324 | # get linker name from arch.fcm file |
---|
| 325 | archfileline=$( grep -i '^%LINK' arch.fcm ) |
---|
| 326 | linker=$( echo ${archfileline##%LINK} ) |
---|
| 327 | |
---|
| 328 | # get ar command from arch.fcm file |
---|
[3045] | 329 | archfileline=$( grep -i '^%AR ' arch.fcm ) |
---|
[1463] | 330 | arcommand=$( echo ${archfileline##%AR} ) |
---|
| 331 | |
---|
[3045] | 332 | # get ar command options from arch.fcm file |
---|
| 333 | archfileline=$( grep -i '^%ARFLAGS' arch.fcm ) |
---|
[3051] | 334 | arflags=$( echo ${archfileline##%ARFLAGS} ) |
---|
[3045] | 335 | |
---|
[1463] | 336 | # get make utility from arch.fcm file |
---|
| 337 | archfileline=$( grep -i '^%MAKE' arch.fcm ) |
---|
| 338 | makecommand=$( echo ${archfileline##%MAKE} ) |
---|
| 339 | |
---|
| 340 | # get basic libraries to link with arch.fcm file |
---|
| 341 | archfileline=$( grep -i '^%BASE_LD' arch.fcm ) |
---|
| 342 | archfileopt=$( echo ${archfileline##%BASE_LD} ) |
---|
| 343 | LIB="$LIB ${archfileopt}" |
---|
| 344 | |
---|
[1873] | 345 | # add Include files defined in arch.fcm file for pre-processing |
---|
| 346 | archfileline=$( grep -i '^%FPP_FLAGS' arch.fcm ) |
---|
| 347 | for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done |
---|
| 348 | |
---|
[2250] | 349 | phys_root=$physique |
---|
| 350 | if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi |
---|
| 351 | if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi |
---|
| 352 | if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi |
---|
| 353 | if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi |
---|
| 354 | if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi |
---|
| 355 | if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi |
---|
| 356 | |
---|
[1463] | 357 | if [[ "$physique" != "nophys" ]] |
---|
| 358 | then |
---|
[1690] | 359 | #We'll use some physics |
---|
[2326] | 360 | src_dirs="$src_dirs phy_common phy$physique" |
---|
[2239] | 361 | LIBPHY='$(LIBO)/libphy'"$physique"'.a' |
---|
[2326] | 362 | LIBPHY_COMMON='$(LIBO)/libphy_common.a' |
---|
| 363 | lib_phy='-lphy'"$physique"' -lphy_common' |
---|
[1690] | 364 | CPP_KEY="$CPP_KEY CPP_PHYS" |
---|
[2250] | 365 | if [[ $phys_root == "lmd" ]] |
---|
| 366 | then |
---|
| 367 | #For lmd physics, default planet type is Earth |
---|
| 368 | CPP_KEY="$CPP_KEY CPP_EARTH" |
---|
[1690] | 369 | fi |
---|
[1463] | 370 | fi |
---|
| 371 | |
---|
| 372 | if [[ "$chimie" == "INCA" ]] |
---|
| 373 | then |
---|
| 374 | CPP_KEY="$CPP_KEY INCA" |
---|
| 375 | INCLUDE="$INCLUDE -I${INCA_INCDIR}" |
---|
| 376 | LIB="$LIB -L${INCA_LIBDIR} -lchimie" |
---|
| 377 | libchimie=" -L${INCA_LIBDIR} -lchimie" |
---|
| 378 | fi |
---|
| 379 | |
---|
| 380 | if [[ "$couple" != "false" ]] |
---|
| 381 | then |
---|
| 382 | CPP_KEY="$CPP_KEY CPP_COUPLE" |
---|
| 383 | INCLUDE="$INCLUDE -I${OASIS_INCDIR}" |
---|
| 384 | LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.${couple} -lmpp_io" |
---|
| 385 | fi |
---|
| 386 | |
---|
| 387 | if [[ "$parallel" == "none" ]] |
---|
| 388 | then |
---|
| 389 | FLAG_PARA='' |
---|
| 390 | else |
---|
[1810] | 391 | FLAG_PARA="$paramem" |
---|
[2202] | 392 | if [[ $paramem == par ]] |
---|
| 393 | then |
---|
| 394 | echo "The version of the dynamics in dyn3dpar is no longer updated." |
---|
| 395 | echo "You should use option \"-mem\"." |
---|
| 396 | exit 1 |
---|
[2238] | 397 | fi |
---|
[1463] | 398 | fi |
---|
| 399 | |
---|
| 400 | if [[ "$parallel" == "mpi" ]] |
---|
| 401 | then |
---|
| 402 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI" |
---|
| 403 | # MPI additional compilation options |
---|
| 404 | archfileline=$( grep -i '^%MPI_FFLAGS' arch.fcm ) |
---|
| 405 | PARA_FFLAGS=$( echo ${archfileline##%MPI_FFLAGS} ) |
---|
| 406 | # MPI additional links |
---|
| 407 | archfileline=$( grep -i '^%MPI_LD' arch.fcm ) |
---|
| 408 | PARA_LD=$( echo ${archfileline##%MPI_LD} ) |
---|
| 409 | elif [[ "$parallel" == "omp" ]] |
---|
| 410 | then |
---|
| 411 | CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP" |
---|
| 412 | # OMP additional compilation options |
---|
| 413 | archfileline=$( grep -i '^%OMP_FFLAGS' arch.fcm ) |
---|
| 414 | PARA_FFLAGS=$( echo ${archfileline##%OMP_FFLAGS} ) |
---|
| 415 | # OMP additional links |
---|
| 416 | archfileline=$( grep -i '^%OMP_LD' arch.fcm ) |
---|
| 417 | PARA_LD=$( echo ${archfileline##%OMP_LD} ) |
---|
| 418 | elif [[ "$parallel" == "mpi_omp" ]] |
---|
| 419 | then |
---|
| 420 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP" |
---|
| 421 | # MPI additional compilation options |
---|
| 422 | archfileline=$( grep -i '^%MPI_FFLAGS' arch.fcm ) |
---|
| 423 | PARA_FFLAGS=$( echo ${archfileline##%MPI_FFLAGS} ) |
---|
| 424 | # OMP additional compilation options |
---|
| 425 | archfileline=$( grep -i '^%OMP_FFLAGS' arch.fcm ) |
---|
| 426 | PARA_FFLAGS="${PARA_FFLAGS} "$( echo $archfileopt ${archfileline##%OMP_FFLAGS} ) |
---|
| 427 | # MPI additional links |
---|
| 428 | archfileline=$( grep -i '^%MPI_LD' arch.fcm ) |
---|
| 429 | PARA_LD=$( echo ${archfileline##%MPI_LD} ) |
---|
| 430 | # OMP additional links |
---|
| 431 | archfileline=$( grep -i '^%OMP_LD' arch.fcm ) |
---|
| 432 | PARA_LD="${PARA_LD} "$( echo $archfileopt ${archfileline##%OMP_LD} ) |
---|
| 433 | fi |
---|
| 434 | |
---|
| 435 | if [[ ( "$parallel" == "omp" || "$parallel" == "mpi_omp" ) \ |
---|
| 436 | && "$compil_mod" == "debug" ]] |
---|
| 437 | then |
---|
| 438 | echo "Usually, parallelization with OpenMP requires some optimization." |
---|
| 439 | echo "We suggest switching to \"-dev\"." |
---|
| 440 | fi |
---|
| 441 | |
---|
[1810] | 442 | |
---|
| 443 | #============================================================================== |
---|
[3435] | 444 | if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" -o "$veget" = "orchidee2.1" ] |
---|
[1463] | 445 | then |
---|
[1810] | 446 | |
---|
[1463] | 447 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
---|
[1772] | 448 | CPP_KEY="$CPP_KEY CPP_VEGET" |
---|
[1810] | 449 | # temporary, for Orchidee versions 1.9.* (before openmp activation) |
---|
| 450 | if [[ "$veget" == "orchidee1.9" ]] ; then |
---|
| 451 | CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP" |
---|
| 452 | fi |
---|
| 453 | if [[ "$veget" == "orchidee2.0" ]] ; then |
---|
[1838] | 454 | orch_libs="sechiba parameters stomate parallel orglob orchidee" |
---|
[3435] | 455 | CPP_KEY="$CPP_KEY ORCHIDEE_NOUNSTRUCT" |
---|
| 456 | elif [[ "$veget" == "orchidee2.1" ]] ; then |
---|
| 457 | orch_libs="sechiba parameters stomate parallel orglob orchidee" |
---|
[1810] | 458 | else |
---|
[1811] | 459 | orch_libs="sechiba parameters stomate parallel orglob" |
---|
[1810] | 460 | fi |
---|
| 461 | LIB="${LIB} -L${ORCH_LIBDIR}" |
---|
[1811] | 462 | for lib in ${orch_libs} ; do |
---|
[1810] | 463 | if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then |
---|
| 464 | LIB="${LIB} -l${LIBPREFIX}$lib " |
---|
| 465 | fi |
---|
| 466 | done |
---|
| 467 | elif [[ "$veget" != "false" ]] ; then |
---|
[1772] | 468 | echo "Option -v $veget does not exist" |
---|
| 469 | echo "Use ./makelmdz -h for more information" |
---|
| 470 | exit |
---|
[1463] | 471 | fi |
---|
| 472 | |
---|
[1810] | 473 | #=============================================================================== |
---|
[4201] | 474 | INCLUDE="$INCLUDE -I${NETCDF95_INCDIR}" |
---|
| 475 | LIB="$LIB -L${NETCDF95_LIBDIR} -l${LIBPREFIX}netcdf95" |
---|
| 476 | |
---|
[1463] | 477 | if [[ $io == ioipsl ]] |
---|
| 478 | then |
---|
| 479 | CPP_KEY="$CPP_KEY CPP_IOIPSL" |
---|
| 480 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}" |
---|
| 481 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl" |
---|
[2097] | 482 | elif [[ $io == mix ]] |
---|
[1897] | 483 | then |
---|
| 484 | # For now, xios implies also using ioipsl |
---|
| 485 | CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS" |
---|
| 486 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}" |
---|
[3075] | 487 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++" |
---|
[2097] | 488 | elif [[ $io == xios ]] |
---|
| 489 | then |
---|
| 490 | # For now, xios implies also using ioipsl |
---|
| 491 | CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT" |
---|
| 492 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}" |
---|
[3075] | 493 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++" |
---|
[1463] | 494 | fi |
---|
| 495 | |
---|
| 496 | if [[ "$cosp" == "true" ]] |
---|
| 497 | then |
---|
| 498 | CPP_KEY="$CPP_KEY CPP_COSP" |
---|
[3232] | 499 | # COSP_PATH="$LIBFGCM/phylmd/cosp" |
---|
| 500 | src_dirs="$src_dirs phy${physique}/cosp" |
---|
[1463] | 501 | # LIB="${LIB} -l${LIBPREFIX}cosp" |
---|
[3232] | 502 | # opt_dep="$opt_dep cosp" |
---|
| 503 | # lcosp="-l${LIBPREFIX}cosp" |
---|
| 504 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cosp' |
---|
[1463] | 505 | fi |
---|
| 506 | |
---|
[3359] | 507 | if [[ "$cosp2" == "true" ]] |
---|
| 508 | then |
---|
| 509 | CPP_KEY="$CPP_KEY CPP_COSP2" |
---|
| 510 | src_dirs="$src_dirs phy${physique}/cosp2" |
---|
| 511 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cosp2' |
---|
| 512 | fi |
---|
| 513 | |
---|
[3491] | 514 | if [[ "$cospv2" == "true" ]] |
---|
| 515 | then |
---|
| 516 | CPP_KEY="$CPP_KEY CPP_COSPV2" |
---|
| 517 | src_dirs="$src_dirs phy${physique}/cospv2" |
---|
| 518 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cospv2' |
---|
| 519 | fi |
---|
[3359] | 520 | |
---|
[3491] | 521 | |
---|
[3793] | 522 | if [[ "$inlandsis" == "true" ]] |
---|
| 523 | then |
---|
| 524 | CPP_KEY="$CPP_KEY CPP_INLANDSIS" |
---|
| 525 | src_dirs="$src_dirs phy${physique}/inlandsis" |
---|
| 526 | fi |
---|
| 527 | |
---|
| 528 | |
---|
[3908] | 529 | if [[ "$rad" == "rrtm" ]] |
---|
[1990] | 530 | then |
---|
| 531 | CPP_KEY="$CPP_KEY CPP_RRTM" |
---|
[2238] | 532 | src_dirs="$src_dirs phy${physique}/rrtm" |
---|
[1990] | 533 | fi |
---|
[3908] | 534 | if [[ "$rad" == "ecrad" ]] |
---|
| 535 | then |
---|
| 536 | CPP_KEY="$CPP_KEY CPP_ECRAD" |
---|
| 537 | src_dirs="$src_dirs phy${physique}/ecrad" |
---|
| 538 | fi |
---|
[1865] | 539 | |
---|
[2631] | 540 | if [[ "$dust" == "true" ]] |
---|
| 541 | then |
---|
| 542 | CPP_KEY="$CPP_KEY CPP_Dust" |
---|
| 543 | src_dirs="$src_dirs phy${physique}/Dust" |
---|
| 544 | fi |
---|
[1990] | 545 | |
---|
[2690] | 546 | if [[ "$strataer" == "true" ]] |
---|
| 547 | then |
---|
| 548 | CPP_KEY="$CPP_KEY CPP_StratAer" |
---|
| 549 | src_dirs="$src_dirs phy${physique}/StratAer" |
---|
| 550 | fi |
---|
[2631] | 551 | |
---|
[3835] | 552 | #add new ocean skin modelisation to source dir by default |
---|
[2690] | 553 | |
---|
[3835] | 554 | src_dirs="$src_dirs phy${physique}/Ocean_skin" |
---|
| 555 | |
---|
| 556 | |
---|
[1551] | 557 | INCLUDE="$INCLUDE ${NETCDF_INCDIR}" |
---|
| 558 | LIB="$LIB ${NETCDF_LIBDIR}" |
---|
[1463] | 559 | |
---|
| 560 | ######################################################################## |
---|
| 561 | # calcul du nombre de dimensions |
---|
| 562 | ######################################################################## |
---|
| 563 | |
---|
| 564 | |
---|
| 565 | dim_full=$dim |
---|
| 566 | dim=`echo $dim | sed -e 's/[^0-9]/ /g'` |
---|
| 567 | set $dim |
---|
| 568 | dimc=$# |
---|
| 569 | echo calcul de la dimension |
---|
| 570 | echo dim $dim |
---|
| 571 | echo dimc $dimc |
---|
| 572 | |
---|
| 573 | ######################################################################## |
---|
| 574 | # Gestion des dimensions du modele. |
---|
| 575 | # on cree ou remplace le fichier des dimensions |
---|
| 576 | ######################################################################## |
---|
| 577 | |
---|
[1695] | 578 | cd $LIBFGCM/grid |
---|
| 579 | if [[ -f dimensions.h ]] |
---|
| 580 | then |
---|
| 581 | echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' |
---|
| 582 | echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." |
---|
| 583 | echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," |
---|
| 584 | echo vous pouvez continuer en repondant oui. |
---|
| 585 | echo "Voulez-vous vraiment continuer?" |
---|
[1755] | 586 | echo "" |
---|
| 587 | echo "WARNING: you are probably already compiling the model somewhere else." |
---|
| 588 | echo "Wait until the first compilation is finished before launching this one." |
---|
| 589 | echo "If you are sure that you are not compiling elsewhere, just answer " |
---|
| 590 | echo "yes (or 'oui') to the question below to proceed." |
---|
| 591 | echo "Do you wish to continue?" |
---|
[1695] | 592 | read reponse |
---|
[1755] | 593 | if [[ $reponse == "oui" || $reponse == "yes" ]] |
---|
[1695] | 594 | then |
---|
[1696] | 595 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1695] | 596 | else |
---|
| 597 | exit |
---|
| 598 | fi |
---|
| 599 | fi |
---|
| 600 | |
---|
[1463] | 601 | cd $LIBFGCM/grid/dimension |
---|
| 602 | ./makdim $dim |
---|
[2202] | 603 | if (($? != 0)) |
---|
| 604 | then |
---|
| 605 | exit 1 |
---|
| 606 | fi |
---|
| 607 | |
---|
[1463] | 608 | cat $LIBFGCM/grid/dimensions.h |
---|
| 609 | cd $LMDGCM |
---|
| 610 | |
---|
| 611 | ######################################################################## |
---|
| 612 | # Differentes dynamiques (3d, 2d, 1d) |
---|
| 613 | ######################################################################## |
---|
| 614 | |
---|
[1810] | 615 | if (( $dimc == 3 )) ; then |
---|
[2238] | 616 | src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}" |
---|
[2239] | 617 | if [[ $physique != "nophys" ]] ; then |
---|
[2417] | 618 | src_dirs="$src_dirs dynphy_lonlat dynphy_lonlat/phy${phys_root}" |
---|
| 619 | libdyn_phy="-ldynphy_lonlat" |
---|
| 620 | LIBDYN_PHYS='$(LIBO)/libdynphy_lonlat.a' |
---|
| 621 | INCLUDE="$INCLUDE "'-I$(LIBF)/dynphy_lonlat' |
---|
| 622 | INCLUDE="$INCLUDE "'-I$(LIBF)/dynphy_lonlat/'"phy${phys_root}" |
---|
[2239] | 623 | fi |
---|
[1810] | 624 | cd $LIBFGCM/grid |
---|
| 625 | \rm fxyprim.h |
---|
| 626 | cp -p fxy_${grille}.h fxyprim.h |
---|
[1463] | 627 | filtre="FILTRE=$filtre" |
---|
[2016] | 628 | INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common ' |
---|
[1810] | 629 | elif (( $dimc == 2 )) ; then |
---|
[2239] | 630 | src_dirs="$src_dirs dyn2d" |
---|
[1810] | 631 | filtre="FILTRE= L_FILTRE= " |
---|
| 632 | INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d' |
---|
| 633 | elif (( $dimc == 1 )) ; then |
---|
[2239] | 634 | #src_dirs="$src_dirs dyn3d dyn3d_common filtrez" |
---|
| 635 | src_dirs="$src_dirs phy${physique}/dyn1d" |
---|
[2023] | 636 | CPP_KEY="$CPP_KEY CPP_1D" |
---|
[2239] | 637 | filtre="L_DYN= DYN= FILTRE= L_FILTRE= " |
---|
| 638 | #INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d -I$(LIBF)/dyn3d_common ' # Pas tres propre |
---|
| 639 | INCLUDE="$INCLUDE "' -I$(LIBF)/phy'"$physique"'/dyn1d' |
---|
[1463] | 640 | else |
---|
[1810] | 641 | echo Dimension dimc=$dimc pas prevu ; exit |
---|
[1463] | 642 | fi |
---|
| 643 | |
---|
| 644 | cd $LMDGCM |
---|
| 645 | |
---|
[2112] | 646 | ######################################################################## |
---|
| 647 | # library directory name: |
---|
| 648 | ######################################################################## |
---|
[1463] | 649 | |
---|
[4203] | 650 | nomlib=`echo ${arch}_${physique}_${rad}_${dim_full}_${grille}_${compil_mod}_parall${parallel}_${CPP_KEY}_${FLAG_PARA} | sed -e 's/ //g' -e 's/-//g ' | sed -e 's/CPP_//g'` |
---|
[2112] | 651 | echo "Path to library: "$nomlib |
---|
| 652 | |
---|
[1463] | 653 | ######################################################################## |
---|
[2112] | 654 | # Cleanup for a full recompilation, if requested |
---|
| 655 | ######################################################################## |
---|
| 656 | |
---|
| 657 | if [[ $full == "full" ]] |
---|
| 658 | then |
---|
| 659 | # remove makefile and librairies |
---|
| 660 | echo "-full option: recompiling from scratch" |
---|
| 661 | \rm -f makefile |
---|
| 662 | \rm -rf "${LIBOGCM}/${nomlib}" |
---|
| 663 | fi |
---|
| 664 | |
---|
| 665 | ######################################################################## |
---|
[1463] | 666 | # Avant de lancer le make, on recree le makefile si necessaire |
---|
| 667 | ######################################################################## |
---|
| 668 | ######################################################################## |
---|
| 669 | # c'est a dire dans 3 cas: |
---|
| 670 | # 1. si la liste des fichiers .F et .h a ete modifiee depuis la |
---|
| 671 | # derniere creation du makefile |
---|
| 672 | # 2. si le fichier contenant cette liste "liste_des_sources" |
---|
| 673 | # n'existe pas. |
---|
| 674 | # 3. Si le makefile n'existe pas. |
---|
| 675 | ######################################################################## |
---|
| 676 | cd $LMDGCM |
---|
[1810] | 677 | |
---|
[1463] | 678 | |
---|
[2238] | 679 | if [[ -r .makelmdz ]] |
---|
[1463] | 680 | then |
---|
[2238] | 681 | old_lmdz_configuration=$(cat .makelmdz ) |
---|
| 682 | else |
---|
| 683 | old_lmdz_configuration="" |
---|
| 684 | fi |
---|
| 685 | lmdz_configuration="$src_dirs" |
---|
| 686 | if [[ "$lmdz_configuration" != "$old_lmdz_configuration" ]] |
---|
| 687 | then |
---|
| 688 | configuration_change="true" |
---|
| 689 | else |
---|
| 690 | configuration_change="false" |
---|
| 691 | fi |
---|
| 692 | |
---|
[2250] | 693 | mkdir -p make_dir |
---|
| 694 | suf_make=`echo $src_dirs | sed -e 's/\//_/g' -e 's/ /_/g'` |
---|
| 695 | echo suf_make $suf_make |
---|
| 696 | |
---|
[4085] | 697 | ######################################################################## |
---|
| 698 | # (re)Creation du makefile |
---|
| 699 | ######################################################################## |
---|
| 700 | |
---|
| 701 | echo "Controle de la necessite de recreer le makefile" |
---|
[2250] | 702 | \rm tmp77 tmp90 |
---|
| 703 | for dir in $src_dirs ; do |
---|
[4085] | 704 | # On recupere la liste de tous les subroutine, use et include pour |
---|
| 705 | # vérifier que les dépendense n'ont pas changé et reconstuire le |
---|
| 706 | # makefile le cas échéant |
---|
| 707 | # On enleve tout apres ONLy et on met un "uniq" pour que ca ne recrée pas |
---|
| 708 | # le makefile si on se contente d'ajouter des lignes dans le ONLY |
---|
| 709 | for str in subroutine "use " "include " ; do |
---|
| 710 | grep -i "$str" libf/$dir/*.[Fh] | cut -d\( -f1 | sed -e 's/[Oo][Nn][Ll][Yy].*.$//' | uniq >> tmp77 |
---|
| 711 | grep -i "$str" libf/$dir/*.F90 | cut -d\( -f1 | sed -e 's/[Oo][Nn][Ll][Yy].*.$//' | uniq >> tmp90 |
---|
| 712 | done |
---|
[2250] | 713 | done |
---|
| 714 | |
---|
| 715 | liste77=make_dir/liste_des_sources_f77_$suf_make |
---|
| 716 | liste90=make_dir/liste_des_sources_f90_$suf_make |
---|
| 717 | makefile=make_dir/makefile_$suf_make |
---|
| 718 | |
---|
[2269] | 719 | if [[ $configuration_change == "true" || ! ( -r $makefile ) || ! ( -r $liste90 ) || ! ( -r $liste77 ) || ` diff tmp77 $liste77 | wc -w ` -ne 0 || ` diff tmp90 $liste90 | wc -w ` -ne 0 ]] |
---|
[2238] | 720 | then |
---|
[1463] | 721 | echo "les fichiers suivants ont ete crees ou detruits" |
---|
| 722 | echo "ou les fichiers suivants sont passes ou ne sont plus en Fortran 90" |
---|
[2250] | 723 | diff $liste77 tmp77 |
---|
| 724 | diff $liste90 tmp90 |
---|
| 725 | \cp -f tmp77 $liste77 |
---|
| 726 | \cp -f tmp90 $liste90 |
---|
[2238] | 727 | echo "Recreating the makefile" |
---|
| 728 | echo "src_dirs: $src_dirs" |
---|
| 729 | ./create_make_gcm $src_dirs > tmp |
---|
[2250] | 730 | \mv -f tmp $makefile |
---|
[2238] | 731 | echo "New makefile created" |
---|
[4085] | 732 | else |
---|
| 733 | echo Pas besoin de recreer le makefile |
---|
[1463] | 734 | fi |
---|
| 735 | |
---|
[4085] | 736 | |
---|
[2250] | 737 | ln -sf $makefile makefile |
---|
[2238] | 738 | echo "$lmdz_configuration" > .makelmdz |
---|
| 739 | |
---|
[1463] | 740 | ################################################################# |
---|
| 741 | # Preparation de l'execution de la comande make |
---|
| 742 | ################################################################# |
---|
| 743 | |
---|
| 744 | source_code=${code}.F |
---|
[2239] | 745 | dirmain=dyn${dimc}d${FLAG_PARA} |
---|
[1463] | 746 | if [[ -r $LMDGCM/libf/dyn${dimc}d${FLAG_PARA}/${code}.F90 ]] |
---|
| 747 | then |
---|
| 748 | source_code=${code}.F90 |
---|
[2016] | 749 | elif [[ -r $LMDGCM/libf/phy$physique/${code}.F90 ]] ; then |
---|
[2239] | 750 | dirmain=phy$physique |
---|
[2016] | 751 | source_code=${code}.F90 |
---|
[2417] | 752 | elif [[ -r $LMDGCM/libf/dynphy_lonlat/phy$phys_root/${code}.F90 ]] ; then |
---|
| 753 | dirmain="dynphy_lonlat/phy${phys_root}" |
---|
[2239] | 754 | source_code=${code}.F90 |
---|
| 755 | elif [[ -r $LMDGCM/libf/phy$physique/dyn1d/${code}.F90 ]] ; then |
---|
| 756 | dirmain=phy$physique/dyn1d |
---|
| 757 | source_code=${code}.F90 |
---|
[1463] | 758 | fi |
---|
| 759 | |
---|
| 760 | if [[ ! -d "${LIBOGCM}/${nomlib}" ]] |
---|
| 761 | then |
---|
| 762 | mkdir ${LIBOGCM}/${nomlib} |
---|
| 763 | # check we indeed managed to create the directory |
---|
| 764 | if [[ ! $? ]] |
---|
| 765 | then |
---|
| 766 | echo "Error: could not create directory ${LIBOGCM}/${nomlib}" |
---|
| 767 | exit |
---|
| 768 | fi |
---|
| 769 | fi |
---|
| 770 | |
---|
| 771 | # where module files are created |
---|
| 772 | mod_loc_dir=$localdir |
---|
| 773 | |
---|
| 774 | if [[ "$physique" != "nophys" ]] |
---|
| 775 | then |
---|
| 776 | INCLUDE="$INCLUDE"' -I$(LIBF)/phy'"$physique" |
---|
| 777 | fi |
---|
[1810] | 778 | INCLUDE="$INCLUDE"' -I'${LIBOGCM}/${nomlib} |
---|
[1463] | 779 | |
---|
| 780 | # ranlib utility (check it exists or else default to ls) |
---|
| 781 | if [[ `which ranlib > /dev/null 2>&1 ; echo $?` -eq 0 ]] |
---|
| 782 | then |
---|
| 783 | ranlib="ranlib" |
---|
| 784 | else |
---|
| 785 | ranlib="ls" |
---|
| 786 | fi |
---|
| 787 | |
---|
| 788 | # add CPP keys to COMPIL_FLAGS |
---|
| 789 | # (but first add -D before all CPP_KEY items) |
---|
| 790 | cpp_definitions=`echo $CPP_KEY | sed -e 's/[A-Za-z_=0-9]*/-D&/g'` |
---|
| 791 | # (but add a -WF,-D before all CPP_KEY items) => for xlf on Vargas |
---|
| 792 | if [[ "${fcompiler:0:3}" == "xlf" ]] |
---|
| 793 | then |
---|
| 794 | cpp_definitions=`echo $CPP_KEY | sed -e 's/[A-Za-z_=0-9]*/-WF,-D&/g'` |
---|
| 795 | fi |
---|
| 796 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${cpp_definitions}" |
---|
| 797 | |
---|
| 798 | ################################################################# |
---|
| 799 | # Execution du make |
---|
| 800 | ################################################################# |
---|
| 801 | echo $makecommand RANLIB=$ranlib -f $LMDGCM/makefile \ |
---|
| 802 | OPTION_DEP="$opt_dep" OPTION_LINK="$LIB ${PARA_LD}" \ |
---|
| 803 | OPTIM90="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 804 | OPTIMTRU90="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 805 | OPTIM="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 806 | INCLUDE="$INCLUDE" \ |
---|
| 807 | $filtre \ |
---|
| 808 | LIBO=${LIBOGCM}/${nomlib} \ |
---|
| 809 | "PHYS=$physique" \ |
---|
[2239] | 810 | LIBPHY=${LIBPHY} \ |
---|
[2326] | 811 | LIBPHY_COMMON=${LIBPHY_COMMON} \ |
---|
[2239] | 812 | LIBDYN_PHYS=${LIBDYN_PHYS} \ |
---|
[1463] | 813 | DIM=$dimc \ |
---|
| 814 | FLAG_PARA=$FLAG_PARA \ |
---|
[2239] | 815 | L_PHY="$lib_phy" \ |
---|
| 816 | L_DYN_PHY="$libdyn_phy" \ |
---|
[1463] | 817 | L_ADJNT=$adjnt \ |
---|
| 818 | L_COSP="$lcosp" \ |
---|
[3359] | 819 | L_COSP2="$lcosp2" \ |
---|
[3491] | 820 | L_COSPV2="$lcospv2" \ |
---|
[1463] | 821 | L_CHIMIE="$libchimie" \ |
---|
| 822 | LOCAL_DIR="$localdir" \ |
---|
| 823 | F77="$fcompiler" \ |
---|
| 824 | F90="$fcompiler" \ |
---|
| 825 | OPLINK="$LIB" \ |
---|
| 826 | LINK="$linker" \ |
---|
| 827 | GCM="$LMDGCM" \ |
---|
| 828 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 829 | MOD_SUFFIX="mod" \ |
---|
| 830 | AR=$arcommand \ |
---|
[3051] | 831 | ARFLAGS="$arflags" \ |
---|
[2239] | 832 | DIRMAIN=$dirmain \ |
---|
[1463] | 833 | SOURCE=$source_code \ |
---|
| 834 | PROG=$code |
---|
| 835 | |
---|
| 836 | $makecommand RANLIB=$ranlib -f $LMDGCM/makefile \ |
---|
| 837 | OPTION_DEP="$opt_dep" OPTION_LINK="$LIB ${PARA_LD}" \ |
---|
| 838 | OPTIM90="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 839 | OPTIMTRU90="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 840 | OPTIM="${COMPIL_FFLAGS} ${PARA_FFLAGS}" \ |
---|
| 841 | INCLUDE="$INCLUDE" \ |
---|
| 842 | $filtre \ |
---|
| 843 | LIBO=${LIBOGCM}/${nomlib} \ |
---|
| 844 | "PHYS=$physique" \ |
---|
[2239] | 845 | LIBPHY=${LIBPHY} \ |
---|
[2326] | 846 | LIBPHY_COMMON=${LIBPHY_COMMON} \ |
---|
[2239] | 847 | LIBDYN_PHYS=${LIBDYN_PHYS} \ |
---|
[1463] | 848 | DIM=$dimc \ |
---|
| 849 | FLAG_PARA=$FLAG_PARA \ |
---|
[2239] | 850 | L_PHY="$lib_phy" \ |
---|
| 851 | L_DYN_PHY="$libdyn_phy" \ |
---|
[1810] | 852 | L_ADJNT=$adjnt \ |
---|
[1463] | 853 | L_COSP="$lcosp" \ |
---|
[3359] | 854 | L_COSP2="$lcosp2" \ |
---|
[3491] | 855 | L_COSPV2="$lcospv2" \ |
---|
[1463] | 856 | L_CHIMIE="$libchimie" \ |
---|
| 857 | LOCAL_DIR="$localdir" \ |
---|
| 858 | F77="$fcompiler" \ |
---|
| 859 | F90="$fcompiler" \ |
---|
| 860 | OPLINK="$LIB" \ |
---|
| 861 | LINK="$linker" \ |
---|
| 862 | GCM="$LMDGCM" \ |
---|
| 863 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 864 | MOD_SUFFIX="mod" \ |
---|
| 865 | AR=$arcommand \ |
---|
[3051] | 866 | ARFLAGS="$arflags" \ |
---|
[2239] | 867 | DIRMAIN=$dirmain \ |
---|
[1463] | 868 | SOURCE=$source_code \ |
---|
| 869 | PROG=$code |
---|
| 870 | |
---|
[1810] | 871 | |
---|
[1696] | 872 | if [[ -r $LIBFGCM/grid/dimensions.h ]] |
---|
[1463] | 873 | then |
---|
| 874 | # Cleanup: remove dimension.h file |
---|
[1696] | 875 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1463] | 876 | fi |
---|