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