| 1 | #!/bin/bash |
|---|
| 2 | # |
|---|
| 3 | # $Id$ |
|---|
| 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 |
|---|
| 21 | paramem="par" |
|---|
| 22 | compil_mod=prod |
|---|
| 23 | io=ioipsl |
|---|
| 24 | LIBPREFIX="" |
|---|
| 25 | fcm_path=none |
|---|
| 26 | cosp=false |
|---|
| 27 | cosp2=false |
|---|
| 28 | cospv2=false |
|---|
| 29 | inlandsis=false |
|---|
| 30 | rrtm=false |
|---|
| 31 | rad="" |
|---|
| 32 | dust=false |
|---|
| 33 | strataer=false |
|---|
| 34 | full="" |
|---|
| 35 | |
|---|
| 36 | arch_defined="FALSE" |
|---|
| 37 | arch_path="arch" |
|---|
| 38 | arch_default_path="arch" |
|---|
| 39 | |
|---|
| 40 | # guess a default 'arch' |
|---|
| 41 | arch="local" # start with assuming we're on a local machine with local arch file |
|---|
| 42 | arch_defined="TRUE" # and thus also set arch_defined to true |
|---|
| 43 | ## try to recognise machine and infer arch from it |
|---|
| 44 | machine=`hostname` |
|---|
| 45 | if [[ "${machine:0:4}" == "jean" ]] |
|---|
| 46 | then |
|---|
| 47 | arch="X64_JEANZAY" |
|---|
| 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 |
|---|
| 79 | #COSP_PATH=$LMDGCM/.void_dir |
|---|
| 80 | |
|---|
| 81 | |
|---|
| 82 | |
|---|
| 83 | localdir=`pwd -P` |
|---|
| 84 | ######################################################################## |
|---|
| 85 | # Quelques initialisations de variables du shell. |
|---|
| 86 | ######################################################################## |
|---|
| 87 | |
|---|
| 88 | CPP_KEY="IN_LMDZ" |
|---|
| 89 | INCLUDE='-I$(LIBF)/grid -I$(LIBF)/misc -I$(LIBF)/filtrez -I. ' |
|---|
| 90 | LIB="" |
|---|
| 91 | adjnt="" |
|---|
| 92 | ##COMPIL_FFLAGS="%PROD_FFLAGS" |
|---|
| 93 | PARA_FFLAGS="" |
|---|
| 94 | PARA_LD="" |
|---|
| 95 | EXT_SRC="" |
|---|
| 96 | #src_dirs: directories containing source files |
|---|
| 97 | src_dirs="grid misc" |
|---|
| 98 | ######################################################################## |
|---|
| 99 | # lecture des options |
|---|
| 100 | ######################################################################## |
|---|
| 101 | |
|---|
| 102 | while (($# > 0)) |
|---|
| 103 | do |
|---|
| 104 | case $1 in |
|---|
| 105 | "-h") cat <<fin |
|---|
| 106 | Usage : |
|---|
| 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 |
|---|
| 115 | orchidee2.1 : compile using ORCHIDEE 2.1 (or more recent version) |
|---|
| 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) |
|---|
| 120 | [-cosp true/false] : compile with/without cosp package (default: false) |
|---|
| 121 | [-cosp2 true/false] : compile with/without cosp2 package (default: false) |
|---|
| 122 | [-cospv2 true/false] : compile with/without cospv2 package (default: false) |
|---|
| 123 | [-inlandsis true/false] : compile with/without inlandsis package (default: false) |
|---|
| 124 | [-rrtm true/false] : compile with/without rrtm package (default: false) |
|---|
| 125 | [-rad old/rrtm/ecrad] : compile with old/rrtm/ecrad radiatif code (default: old) |
|---|
| 126 | [-dust true/false] : compile with/without the dust package from Boucher et al. (default: false) |
|---|
| 127 | [-strataer true/false] : compile with/without the strat aer package from Boucher et al. (default: false) |
|---|
| 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) |
|---|
| 130 | [-io ioipsl/mix/xios] : Input/Output library (default: ioipsl) |
|---|
| 131 | [-include INCLUDES] : extra include path to add |
|---|
| 132 | [-cpp CPP_KEY] : additional preprocessing definitions |
|---|
| 133 | [-adjnt] : adjoint model, not operational ... |
|---|
| 134 | [-mem] : reduced memory dynamics (if in parallel mode) |
|---|
| 135 | [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) |
|---|
| 136 | [-full] : Full (re)compilation (from scratch) |
|---|
| 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 |
|---|
| 140 | [-arch_path path] : path to architecture files (default: $arch_default_path) |
|---|
| 141 | -arch nom_arch : target architecture |
|---|
| 142 | exec : executable to build |
|---|
| 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 ;; |
|---|
| 186 | |
|---|
| 187 | "-cosp2") |
|---|
| 188 | cosp2="$2" ; shift ; shift ;; |
|---|
| 189 | |
|---|
| 190 | "-cosp2") |
|---|
| 191 | cospv2="$2" ; shift ; shift ;; |
|---|
| 192 | |
|---|
| 193 | "-inlandsis") |
|---|
| 194 | inlandsis="$2" ; shift ; shift ;; |
|---|
| 195 | |
|---|
| 196 | "-rrtm") |
|---|
| 197 | rrtm="$2" ; if [ "$2" = "false" ] ; then rad="old" ; else rad="rrtm" ; fi ; shift ; shift ;; |
|---|
| 198 | |
|---|
| 199 | "-rad") |
|---|
| 200 | rad="$2" ; shift ; shift ;; |
|---|
| 201 | |
|---|
| 202 | "-dust") |
|---|
| 203 | dust="$2" ; shift ; shift ;; |
|---|
| 204 | |
|---|
| 205 | "-strataer") |
|---|
| 206 | strataer="$2" ; shift ; shift ;; |
|---|
| 207 | |
|---|
| 208 | "-mem") |
|---|
| 209 | paramem="mem" ; shift ;; |
|---|
| 210 | |
|---|
| 211 | "-filtre") |
|---|
| 212 | filtre=$2 ; shift ; shift ;; |
|---|
| 213 | |
|---|
| 214 | "-full") |
|---|
| 215 | full="full" ; shift ;; |
|---|
| 216 | |
|---|
| 217 | "-link") |
|---|
| 218 | LIB="$LIB $2" ; shift ; shift ;; |
|---|
| 219 | |
|---|
| 220 | "-fcm_path") |
|---|
| 221 | fcm_path=$2 ; shift ; shift ;; |
|---|
| 222 | |
|---|
| 223 | "-ext_src") |
|---|
| 224 | EXT_SRC=$2 ; src_dirs="$src_dirs $EXT_SRC" ; shift ; shift ;; |
|---|
| 225 | |
|---|
| 226 | "-arch") |
|---|
| 227 | arch=$2 ; arch_defined="TRUE" ; shift ; shift ;; |
|---|
| 228 | |
|---|
| 229 | "-arch_path") |
|---|
| 230 | arch_path=$2 ; arch_path_defined="TRUE"; shift ; shift ;; |
|---|
| 231 | |
|---|
| 232 | *) |
|---|
| 233 | code="$1" ; shift ;; |
|---|
| 234 | esac |
|---|
| 235 | done |
|---|
| 236 | |
|---|
| 237 | ############################################################### |
|---|
| 238 | # lecture des chemins propres \`a l'architecture de la machine # |
|---|
| 239 | ############################################################### |
|---|
| 240 | rm -f .void_file |
|---|
| 241 | echo > .void_file |
|---|
| 242 | rm -rf .void_dir |
|---|
| 243 | mkdir .void_dir |
|---|
| 244 | |
|---|
| 245 | if [[ "$arch_defined" == "TRUE" ]] |
|---|
| 246 | then |
|---|
| 247 | rm -f arch.path |
|---|
| 248 | rm -f arch.fcm |
|---|
| 249 | rm -f arch.env |
|---|
| 250 | |
|---|
| 251 | if test -f $arch_path/arch-${arch}.path |
|---|
| 252 | then |
|---|
| 253 | ln -s $arch_path/arch-${arch}.path arch.path |
|---|
| 254 | elif test -f $arch_default_path/arch-${arch}.path |
|---|
| 255 | then |
|---|
| 256 | ln -s $arch_default_path/arch-${arch}.path arch.path |
|---|
| 257 | fi |
|---|
| 258 | |
|---|
| 259 | if test -f $arch_path/arch-${arch}.fcm |
|---|
| 260 | then |
|---|
| 261 | ln -s $arch_path/arch-${arch}.fcm arch.fcm |
|---|
| 262 | elif test -f $arch_default_path/arch-${arch}.fcm |
|---|
| 263 | then |
|---|
| 264 | ln -s $arch_default_path/arch-${arch}.fcm arch.fcm |
|---|
| 265 | fi |
|---|
| 266 | |
|---|
| 267 | if test -f $arch_path/arch-${arch}.env |
|---|
| 268 | then |
|---|
| 269 | ln -s $arch_path/arch-${arch}.env arch.env |
|---|
| 270 | elif test -f $arch_default_path/arch-${arch}.env |
|---|
| 271 | then |
|---|
| 272 | ln -s $arch_default_path/arch-${arch}.env arch.env |
|---|
| 273 | else |
|---|
| 274 | ln -s .void_file arch.env |
|---|
| 275 | fi |
|---|
| 276 | # source architecture PATH and ENV files |
|---|
| 277 | source arch.env |
|---|
| 278 | source arch.path |
|---|
| 279 | else |
|---|
| 280 | echo "You must define a target architecture" |
|---|
| 281 | exit 1 |
|---|
| 282 | fi |
|---|
| 283 | |
|---|
| 284 | ######################################################################## |
|---|
| 285 | # Definition des clefs CPP, des chemins des includes et modules |
|---|
| 286 | # et des libraries |
|---|
| 287 | ######################################################################## |
|---|
| 288 | |
|---|
| 289 | # basic compile flags from arch.fcm file |
|---|
| 290 | archfileline=$( grep -i '^%BASE_FFLAGS' arch.fcm ) |
|---|
| 291 | COMPIL_FFLAGS=$( echo ${archfileline##%BASE_FFLAGS} ) |
|---|
| 292 | |
|---|
| 293 | # other compile flags, depending on compilation mode |
|---|
| 294 | if [[ "$compil_mod" == "prod" ]] |
|---|
| 295 | then |
|---|
| 296 | ## read COMPIL_FFLAGS from arch.fcm file |
|---|
| 297 | archfileline=$( grep -i '^%PROD_FFLAGS' arch.fcm ) |
|---|
| 298 | archfileopt=$( echo ${archfileline##%PROD_FFLAGS} ) |
|---|
| 299 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
|---|
| 300 | elif [[ "$compil_mod" == "dev" ]] |
|---|
| 301 | then |
|---|
| 302 | ## read %DEV_FFLAGS from arch.fcm file |
|---|
| 303 | archfileline=$( grep -i '^%DEV_FFLAGS' arch.fcm ) |
|---|
| 304 | archfileopt=$( echo ${archfileline##%DEV_FFLAGS} ) |
|---|
| 305 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
|---|
| 306 | elif [[ "$compil_mod" == "debug" ]] |
|---|
| 307 | then |
|---|
| 308 | ## read %DEBUG_FFLAGS from arch.fcm file |
|---|
| 309 | archfileline=$( grep -i '^%DEBUG_FFLAGS' arch.fcm ) |
|---|
| 310 | archfileopt=$( echo ${archfileline##%DEBUG_FFLAGS} ) |
|---|
| 311 | COMPIL_FFLAGS="${COMPIL_FFLAGS} ${archfileopt}" |
|---|
| 312 | fi |
|---|
| 313 | |
|---|
| 314 | # add CPP_KEY defined in arch.fcm file |
|---|
| 315 | archfileline=$( grep -i '^%FPP_DEF' arch.fcm ) |
|---|
| 316 | archfileopt=$( echo ${archfileline##%FPP_DEF} ) |
|---|
| 317 | CPP_KEY="$CPP_KEY ${archfileopt}" |
|---|
| 318 | |
|---|
| 319 | # get compiler name from arch.fcm file |
|---|
| 320 | archfileline=$( grep -i '^%COMPILER' arch.fcm ) |
|---|
| 321 | fcompiler=$( echo ${archfileline##%COMPILER} ) |
|---|
| 322 | |
|---|
| 323 | # get linker name from arch.fcm file |
|---|
| 324 | archfileline=$( grep -i '^%LINK' arch.fcm ) |
|---|
| 325 | linker=$( echo ${archfileline##%LINK} ) |
|---|
| 326 | |
|---|
| 327 | # get ar command from arch.fcm file |
|---|
| 328 | archfileline=$( grep -i '^%AR ' arch.fcm ) |
|---|
| 329 | arcommand=$( echo ${archfileline##%AR} ) |
|---|
| 330 | |
|---|
| 331 | # get ar command options from arch.fcm file |
|---|
| 332 | archfileline=$( grep -i '^%ARFLAGS' arch.fcm ) |
|---|
| 333 | arflags=$( echo ${archfileline##%ARFLAGS} ) |
|---|
| 334 | |
|---|
| 335 | # get make utility from arch.fcm file |
|---|
| 336 | archfileline=$( grep -i '^%MAKE' arch.fcm ) |
|---|
| 337 | makecommand=$( echo ${archfileline##%MAKE} ) |
|---|
| 338 | |
|---|
| 339 | # get basic libraries to link with arch.fcm file |
|---|
| 340 | archfileline=$( grep -i '^%BASE_LD' arch.fcm ) |
|---|
| 341 | archfileopt=$( echo ${archfileline##%BASE_LD} ) |
|---|
| 342 | LIB="$LIB ${archfileopt}" |
|---|
| 343 | |
|---|
| 344 | # add Include files defined in arch.fcm file for pre-processing |
|---|
| 345 | archfileline=$( grep -i '^%FPP_FLAGS' arch.fcm ) |
|---|
| 346 | for inc in $archfileline ; do INCLUDE="$INCLUDE `echo $inc | grep '\-I'`" ; done |
|---|
| 347 | |
|---|
| 348 | phys_root=$physique |
|---|
| 349 | if [[ "${physique:0:3}" == "lmd" ]] ; then phys_root=lmd ; fi |
|---|
| 350 | if [[ "${physique:0:4}" == "mars" ]] ; then phys_root=mars ; fi |
|---|
| 351 | if [[ "${physique:0:3}" == "std" ]] ; then phys_root=std ; fi |
|---|
| 352 | if [[ "${physique:0:5}" == "venus" ]] ; then phys_root=venus ; fi |
|---|
| 353 | if [[ "${physique:0:5}" == "titan" ]] ; then phys_root=titan ; fi |
|---|
| 354 | if [[ "${physique:0:3}" == "dev" ]] ; then phys_root=dev ; fi |
|---|
| 355 | |
|---|
| 356 | if [[ "$physique" != "nophys" ]] |
|---|
| 357 | then |
|---|
| 358 | #We'll use some physics |
|---|
| 359 | src_dirs="$src_dirs phy_common phy$physique" |
|---|
| 360 | LIBPHY='$(LIBO)/libphy'"$physique"'.a' |
|---|
| 361 | LIBPHY_COMMON='$(LIBO)/libphy_common.a' |
|---|
| 362 | lib_phy='-lphy'"$physique"' -lphy_common' |
|---|
| 363 | CPP_KEY="$CPP_KEY CPP_PHYS" |
|---|
| 364 | if [[ $phys_root == "lmd" ]] |
|---|
| 365 | then |
|---|
| 366 | #For lmd physics, default planet type is Earth |
|---|
| 367 | CPP_KEY="$CPP_KEY CPP_EARTH" |
|---|
| 368 | fi |
|---|
| 369 | fi |
|---|
| 370 | |
|---|
| 371 | if [[ "$chimie" == "INCA" ]] |
|---|
| 372 | then |
|---|
| 373 | CPP_KEY="$CPP_KEY INCA" |
|---|
| 374 | INCLUDE="$INCLUDE -I${INCA_INCDIR}" |
|---|
| 375 | LIB="$LIB -L${INCA_LIBDIR} -lchimie" |
|---|
| 376 | libchimie=" -L${INCA_LIBDIR} -lchimie" |
|---|
| 377 | fi |
|---|
| 378 | |
|---|
| 379 | if [[ "$couple" != "false" ]] |
|---|
| 380 | then |
|---|
| 381 | CPP_KEY="$CPP_KEY CPP_COUPLE" |
|---|
| 382 | INCLUDE="$INCLUDE -I${OASIS_INCDIR}" |
|---|
| 383 | LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.${couple} -lmpp_io" |
|---|
| 384 | fi |
|---|
| 385 | |
|---|
| 386 | if [[ "$parallel" == "none" ]] |
|---|
| 387 | then |
|---|
| 388 | FLAG_PARA='' |
|---|
| 389 | else |
|---|
| 390 | FLAG_PARA="$paramem" |
|---|
| 391 | if [[ $paramem == par ]] |
|---|
| 392 | then |
|---|
| 393 | echo "The version of the dynamics in dyn3dpar is no longer updated." |
|---|
| 394 | echo "You should use option \"-mem\"." |
|---|
| 395 | exit 1 |
|---|
| 396 | fi |
|---|
| 397 | fi |
|---|
| 398 | |
|---|
| 399 | if [[ "$parallel" == "mpi" ]] |
|---|
| 400 | then |
|---|
| 401 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI" |
|---|
| 402 | # MPI additional compilation options |
|---|
| 403 | archfileline=$( grep -i '^%MPI_FFLAGS' arch.fcm ) |
|---|
| 404 | PARA_FFLAGS=$( echo ${archfileline##%MPI_FFLAGS} ) |
|---|
| 405 | # MPI additional links |
|---|
| 406 | archfileline=$( grep -i '^%MPI_LD' arch.fcm ) |
|---|
| 407 | PARA_LD=$( echo ${archfileline##%MPI_LD} ) |
|---|
| 408 | elif [[ "$parallel" == "omp" ]] |
|---|
| 409 | then |
|---|
| 410 | CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP" |
|---|
| 411 | # OMP additional compilation options |
|---|
| 412 | archfileline=$( grep -i '^%OMP_FFLAGS' arch.fcm ) |
|---|
| 413 | PARA_FFLAGS=$( echo ${archfileline##%OMP_FFLAGS} ) |
|---|
| 414 | # OMP additional links |
|---|
| 415 | archfileline=$( grep -i '^%OMP_LD' arch.fcm ) |
|---|
| 416 | PARA_LD=$( echo ${archfileline##%OMP_LD} ) |
|---|
| 417 | elif [[ "$parallel" == "mpi_omp" ]] |
|---|
| 418 | then |
|---|
| 419 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP" |
|---|
| 420 | # MPI additional compilation options |
|---|
| 421 | archfileline=$( grep -i '^%MPI_FFLAGS' arch.fcm ) |
|---|
| 422 | PARA_FFLAGS=$( echo ${archfileline##%MPI_FFLAGS} ) |
|---|
| 423 | # OMP additional compilation options |
|---|
| 424 | archfileline=$( grep -i '^%OMP_FFLAGS' arch.fcm ) |
|---|
| 425 | PARA_FFLAGS="${PARA_FFLAGS} "$( echo $archfileopt ${archfileline##%OMP_FFLAGS} ) |
|---|
| 426 | # MPI additional links |
|---|
| 427 | archfileline=$( grep -i '^%MPI_LD' arch.fcm ) |
|---|
| 428 | PARA_LD=$( echo ${archfileline##%MPI_LD} ) |
|---|
| 429 | # OMP additional links |
|---|
| 430 | archfileline=$( grep -i '^%OMP_LD' arch.fcm ) |
|---|
| 431 | PARA_LD="${PARA_LD} "$( echo $archfileopt ${archfileline##%OMP_LD} ) |
|---|
| 432 | fi |
|---|
| 433 | |
|---|
| 434 | if [[ ( "$parallel" == "omp" || "$parallel" == "mpi_omp" ) \ |
|---|
| 435 | && "$compil_mod" == "debug" ]] |
|---|
| 436 | then |
|---|
| 437 | echo "Usually, parallelization with OpenMP requires some optimization." |
|---|
| 438 | echo "We suggest switching to \"-dev\"." |
|---|
| 439 | fi |
|---|
| 440 | |
|---|
| 441 | |
|---|
| 442 | #============================================================================== |
|---|
| 443 | if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" -o "$veget" = "orchidee2.1" ] |
|---|
| 444 | then |
|---|
| 445 | |
|---|
| 446 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
|---|
| 447 | CPP_KEY="$CPP_KEY CPP_VEGET" |
|---|
| 448 | # temporary, for Orchidee versions 1.9.* (before openmp activation) |
|---|
| 449 | if [[ "$veget" == "orchidee1.9" ]] ; then |
|---|
| 450 | CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP" |
|---|
| 451 | fi |
|---|
| 452 | if [[ "$veget" == "orchidee2.0" ]] ; then |
|---|
| 453 | orch_libs="sechiba parameters stomate parallel orglob orchidee" |
|---|
| 454 | CPP_KEY="$CPP_KEY ORCHIDEE_NOUNSTRUCT" |
|---|
| 455 | elif [[ "$veget" == "orchidee2.1" ]] ; then |
|---|
| 456 | orch_libs="sechiba parameters stomate parallel orglob orchidee" |
|---|
| 457 | else |
|---|
| 458 | orch_libs="sechiba parameters stomate parallel orglob" |
|---|
| 459 | fi |
|---|
| 460 | LIB="${LIB} -L${ORCH_LIBDIR}" |
|---|
| 461 | for lib in ${orch_libs} ; do |
|---|
| 462 | if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then |
|---|
| 463 | LIB="${LIB} -l${LIBPREFIX}$lib " |
|---|
| 464 | fi |
|---|
| 465 | done |
|---|
| 466 | elif [[ "$veget" != "false" ]] ; then |
|---|
| 467 | echo "Option -v $veget does not exist" |
|---|
| 468 | echo "Use ./makelmdz -h for more information" |
|---|
| 469 | exit |
|---|
| 470 | fi |
|---|
| 471 | |
|---|
| 472 | #=============================================================================== |
|---|
| 473 | if [[ $io == ioipsl ]] |
|---|
| 474 | then |
|---|
| 475 | CPP_KEY="$CPP_KEY CPP_IOIPSL" |
|---|
| 476 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}" |
|---|
| 477 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl" |
|---|
| 478 | elif [[ $io == mix ]] |
|---|
| 479 | then |
|---|
| 480 | # For now, xios implies also using ioipsl |
|---|
| 481 | CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS" |
|---|
| 482 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}" |
|---|
| 483 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++" |
|---|
| 484 | elif [[ $io == xios ]] |
|---|
| 485 | then |
|---|
| 486 | # For now, xios implies also using ioipsl |
|---|
| 487 | CPP_KEY="$CPP_KEY CPP_IOIPSL CPP_XIOS CPP_IOIPSL_NO_OUTPUT" |
|---|
| 488 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR} -I${XIOS_INCDIR}" |
|---|
| 489 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl -L${XIOS_LIBDIR} -l${LIBPREFIX}stdc++ -l${LIBPREFIX}xios -l${LIBPREFIX}stdc++" |
|---|
| 490 | fi |
|---|
| 491 | |
|---|
| 492 | if [[ "$cosp" == "true" ]] |
|---|
| 493 | then |
|---|
| 494 | CPP_KEY="$CPP_KEY CPP_COSP" |
|---|
| 495 | # COSP_PATH="$LIBFGCM/phylmd/cosp" |
|---|
| 496 | src_dirs="$src_dirs phy${physique}/cosp" |
|---|
| 497 | # LIB="${LIB} -l${LIBPREFIX}cosp" |
|---|
| 498 | # opt_dep="$opt_dep cosp" |
|---|
| 499 | # lcosp="-l${LIBPREFIX}cosp" |
|---|
| 500 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cosp' |
|---|
| 501 | fi |
|---|
| 502 | |
|---|
| 503 | if [[ "$cosp2" == "true" ]] |
|---|
| 504 | then |
|---|
| 505 | CPP_KEY="$CPP_KEY CPP_COSP2" |
|---|
| 506 | src_dirs="$src_dirs phy${physique}/cosp2" |
|---|
| 507 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cosp2' |
|---|
| 508 | fi |
|---|
| 509 | |
|---|
| 510 | if [[ "$cospv2" == "true" ]] |
|---|
| 511 | then |
|---|
| 512 | CPP_KEY="$CPP_KEY CPP_COSPV2" |
|---|
| 513 | src_dirs="$src_dirs phy${physique}/cospv2" |
|---|
| 514 | INCLUDE="$INCLUDE"' -I$(LIBF)/'phy${physique}'/cospv2' |
|---|
| 515 | fi |
|---|
| 516 | |
|---|
| 517 | |
|---|
| 518 | if [[ "$inlandsis" == "true" ]] |
|---|
| 519 | then |
|---|
| 520 | CPP_KEY="$CPP_KEY CPP_INLANDSIS" |
|---|
| 521 | src_dirs="$src_dirs phy${physique}/inlandsis" |
|---|
| 522 | fi |
|---|
| 523 | |
|---|
| 524 | |
|---|
| 525 | if [[ "$rad" == "rrtm" ]] |
|---|
| 526 | then |
|---|
| 527 | CPP_KEY="$CPP_KEY CPP_RRTM" |
|---|
| 528 | src_dirs="$src_dirs phy${physique}/rrtm" |
|---|
| 529 | fi |
|---|
| 530 | if [[ "$rad" == "ecrad" ]] |
|---|
| 531 | then |
|---|
| 532 | CPP_KEY="$CPP_KEY CPP_ECRAD" |
|---|
| 533 | src_dirs="$src_dirs phy${physique}/ecrad" |
|---|
| 534 | fi |
|---|
| 535 | |
|---|
| 536 | if [[ "$dust" == "true" ]] |
|---|
| 537 | then |
|---|
| 538 | CPP_KEY="$CPP_KEY CPP_Dust" |
|---|
| 539 | src_dirs="$src_dirs phy${physique}/Dust" |
|---|
| 540 | fi |
|---|
| 541 | |
|---|
| 542 | if [[ "$strataer" == "true" ]] |
|---|
| 543 | then |
|---|
| 544 | CPP_KEY="$CPP_KEY CPP_StratAer" |
|---|
| 545 | src_dirs="$src_dirs phy${physique}/StratAer" |
|---|
| 546 | fi |
|---|
| 547 | |
|---|
| 548 | #add new ocean skin modelisation to source dir by default |
|---|
| 549 | |
|---|
| 550 | src_dirs="$src_dirs phy${physique}/Ocean_skin" |
|---|
| 551 | |
|---|
| 552 | |
|---|
| 553 | INCLUDE="$INCLUDE ${NETCDF_INCDIR}" |
|---|
| 554 | LIB="$LIB ${NETCDF_LIBDIR}" |
|---|
| 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 | |
|---|
| 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?" |
|---|
| 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?" |
|---|
| 588 | read reponse |
|---|
| 589 | if [[ $reponse == "oui" || $reponse == "yes" ]] |
|---|
| 590 | then |
|---|
| 591 | \rm -f $LIBFGCM/grid/dimensions.h |
|---|
| 592 | else |
|---|
| 593 | exit |
|---|
| 594 | fi |
|---|
| 595 | fi |
|---|
| 596 | |
|---|
| 597 | cd $LIBFGCM/grid/dimension |
|---|
| 598 | ./makdim $dim |
|---|
| 599 | if (($? != 0)) |
|---|
| 600 | then |
|---|
| 601 | exit 1 |
|---|
| 602 | fi |
|---|
| 603 | |
|---|
| 604 | cat $LIBFGCM/grid/dimensions.h |
|---|
| 605 | cd $LMDGCM |
|---|
| 606 | |
|---|
| 607 | ######################################################################## |
|---|
| 608 | # Differentes dynamiques (3d, 2d, 1d) |
|---|
| 609 | ######################################################################## |
|---|
| 610 | |
|---|
| 611 | if (( $dimc == 3 )) ; then |
|---|
| 612 | src_dirs="$src_dirs $filtre dyn3d_common dyn3d${FLAG_PARA}" |
|---|
| 613 | if [[ $physique != "nophys" ]] ; then |
|---|
| 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}" |
|---|
| 619 | fi |
|---|
| 620 | cd $LIBFGCM/grid |
|---|
| 621 | \rm fxyprim.h |
|---|
| 622 | cp -p fxy_${grille}.h fxyprim.h |
|---|
| 623 | filtre="FILTRE=$filtre" |
|---|
| 624 | INCLUDE="$INCLUDE "'-I$(LIBF)/dyn3d${FLAG_PARA} -I$(LIBF)/dyn3d_common ' |
|---|
| 625 | elif (( $dimc == 2 )) ; then |
|---|
| 626 | src_dirs="$src_dirs dyn2d" |
|---|
| 627 | filtre="FILTRE= L_FILTRE= " |
|---|
| 628 | INCLUDE="$INCLUDE "'-I$(LIBF)/dyn2d' |
|---|
| 629 | elif (( $dimc == 1 )) ; then |
|---|
| 630 | #src_dirs="$src_dirs dyn3d dyn3d_common filtrez" |
|---|
| 631 | src_dirs="$src_dirs phy${physique}/dyn1d" |
|---|
| 632 | CPP_KEY="$CPP_KEY CPP_1D" |
|---|
| 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' |
|---|
| 636 | else |
|---|
| 637 | echo Dimension dimc=$dimc pas prevu ; exit |
|---|
| 638 | fi |
|---|
| 639 | |
|---|
| 640 | cd $LMDGCM |
|---|
| 641 | |
|---|
| 642 | ######################################################################## |
|---|
| 643 | # library directory name: |
|---|
| 644 | ######################################################################## |
|---|
| 645 | |
|---|
| 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 | |
|---|
| 649 | ######################################################################## |
|---|
| 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 | ######################################################################## |
|---|
| 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 |
|---|
| 673 | |
|---|
| 674 | |
|---|
| 675 | if [[ -r .makelmdz ]] |
|---|
| 676 | then |
|---|
| 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 | |
|---|
| 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 | |
|---|
| 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 ]] |
|---|
| 704 | then |
|---|
| 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" |
|---|
| 707 | diff $liste77 tmp77 |
|---|
| 708 | diff $liste90 tmp90 |
|---|
| 709 | \cp -f tmp77 $liste77 |
|---|
| 710 | \cp -f tmp90 $liste90 |
|---|
| 711 | echo "Recreating the makefile" |
|---|
| 712 | echo "src_dirs: $src_dirs" |
|---|
| 713 | ./create_make_gcm $src_dirs > tmp |
|---|
| 714 | \mv -f tmp $makefile |
|---|
| 715 | echo "New makefile created" |
|---|
| 716 | fi |
|---|
| 717 | |
|---|
| 718 | ln -sf $makefile makefile |
|---|
| 719 | |
|---|
| 720 | #Create a .makelmdz file containing main compilation option for later comparisons |
|---|
| 721 | echo "$lmdz_configuration" > .makelmdz |
|---|
| 722 | |
|---|
| 723 | ################################################################# |
|---|
| 724 | # Preparation de l'execution de la comande make |
|---|
| 725 | ################################################################# |
|---|
| 726 | |
|---|
| 727 | source_code=${code}.F |
|---|
| 728 | dirmain=dyn${dimc}d${FLAG_PARA} |
|---|
| 729 | if [[ -r $LMDGCM/libf/dyn${dimc}d${FLAG_PARA}/${code}.F90 ]] |
|---|
| 730 | then |
|---|
| 731 | source_code=${code}.F90 |
|---|
| 732 | elif [[ -r $LMDGCM/libf/phy$physique/${code}.F90 ]] ; then |
|---|
| 733 | dirmain=phy$physique |
|---|
| 734 | source_code=${code}.F90 |
|---|
| 735 | elif [[ -r $LMDGCM/libf/dynphy_lonlat/phy$phys_root/${code}.F90 ]] ; then |
|---|
| 736 | dirmain="dynphy_lonlat/phy${phys_root}" |
|---|
| 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 |
|---|
| 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 |
|---|
| 761 | INCLUDE="$INCLUDE"' -I'${LIBOGCM}/${nomlib} |
|---|
| 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" \ |
|---|
| 793 | LIBPHY=${LIBPHY} \ |
|---|
| 794 | LIBPHY_COMMON=${LIBPHY_COMMON} \ |
|---|
| 795 | LIBDYN_PHYS=${LIBDYN_PHYS} \ |
|---|
| 796 | DIM=$dimc \ |
|---|
| 797 | FLAG_PARA=$FLAG_PARA \ |
|---|
| 798 | L_PHY="$lib_phy" \ |
|---|
| 799 | L_DYN_PHY="$libdyn_phy" \ |
|---|
| 800 | L_ADJNT=$adjnt \ |
|---|
| 801 | L_COSP="$lcosp" \ |
|---|
| 802 | L_COSP2="$lcosp2" \ |
|---|
| 803 | L_COSPV2="$lcospv2" \ |
|---|
| 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 \ |
|---|
| 814 | ARFLAGS="$arflags" \ |
|---|
| 815 | DIRMAIN=$dirmain \ |
|---|
| 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" \ |
|---|
| 828 | LIBPHY=${LIBPHY} \ |
|---|
| 829 | LIBPHY_COMMON=${LIBPHY_COMMON} \ |
|---|
| 830 | LIBDYN_PHYS=${LIBDYN_PHYS} \ |
|---|
| 831 | DIM=$dimc \ |
|---|
| 832 | FLAG_PARA=$FLAG_PARA \ |
|---|
| 833 | L_PHY="$lib_phy" \ |
|---|
| 834 | L_DYN_PHY="$libdyn_phy" \ |
|---|
| 835 | L_ADJNT=$adjnt \ |
|---|
| 836 | L_COSP="$lcosp" \ |
|---|
| 837 | L_COSP2="$lcosp2" \ |
|---|
| 838 | L_COSPV2="$lcospv2" \ |
|---|
| 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 \ |
|---|
| 849 | ARFLAGS="$arflags" \ |
|---|
| 850 | DIRMAIN=$dirmain \ |
|---|
| 851 | SOURCE=$source_code \ |
|---|
| 852 | PROG=$code |
|---|
| 853 | |
|---|
| 854 | |
|---|
| 855 | if [[ -r $LIBFGCM/grid/dimensions.h ]] |
|---|
| 856 | then |
|---|
| 857 | # Cleanup: remove dimension.h file |
|---|
| 858 | \rm -f $LIBFGCM/grid/dimensions.h |
|---|
| 859 | fi |
|---|