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