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