[1279] | 1 | #!/bin/bash |
---|
| 2 | # $Id: makelmdz_fcm 1811 2013-07-24 09:42:06Z emillour $ |
---|
| 3 | # This is a script in Bash. |
---|
| 4 | |
---|
[1140] | 5 | # FH : on ne crée plus le fichier arch.mk qui est supposé exister par |
---|
[783] | 6 | # FH : ailleurs. |
---|
[1140] | 7 | # FH : ulterieurement, ce fichier sera pré-existant pour une série |
---|
| 8 | # FH : de configurations en versions optimisées et debug qui seront |
---|
| 9 | # FH : liés (ln -s) avec arch.mk en fonction de l'architecture. |
---|
| 10 | # FH : Pour le moment, cette version est en test et on peut créer les |
---|
| 11 | # FH : arch.mk en lançant une première fois makegcm. |
---|
[783] | 12 | # |
---|
[1279] | 13 | ##set -x |
---|
[783] | 14 | ######################################################################## |
---|
| 15 | # options par defaut pour la commande make |
---|
| 16 | ######################################################################## |
---|
| 17 | |
---|
[1279] | 18 | dim="96x72x19" |
---|
| 19 | physique=lmd |
---|
| 20 | filtre=filtrez |
---|
| 21 | grille=reg |
---|
| 22 | couple=false |
---|
| 23 | veget=false |
---|
| 24 | chimie=false |
---|
| 25 | parallel=none |
---|
[1680] | 26 | paramem="par" |
---|
[1279] | 27 | compil_mod=prod |
---|
| 28 | io=ioipsl |
---|
| 29 | LIBPREFIX="" |
---|
| 30 | cosp=false |
---|
[1802] | 31 | job=1 |
---|
| 32 | full='' |
---|
[783] | 33 | |
---|
[1279] | 34 | LMDGCM=`/bin/pwd` |
---|
| 35 | LIBOGCM=$LMDGCM/libo |
---|
| 36 | LIBFGCM=$LMDGCM/libf |
---|
[1327] | 37 | COSP_PATH=$LMDGCM/.void_dir |
---|
[1578] | 38 | fcm_path=$LMDGCM/tools/fcm/bin |
---|
[783] | 39 | |
---|
| 40 | ######################################################################## |
---|
| 41 | # Quelques initialisations de variables du shell. |
---|
| 42 | ######################################################################## |
---|
| 43 | |
---|
[1279] | 44 | CPP_KEY="" |
---|
| 45 | INCLUDE="" |
---|
| 46 | LIB="" |
---|
| 47 | adjnt="" |
---|
| 48 | COMPIL_FFLAGS="%PROD_FFLAGS" |
---|
| 49 | PARA_FFLAGS="" |
---|
| 50 | PARA_LD="" |
---|
| 51 | EXT_SRC="" |
---|
[783] | 52 | |
---|
| 53 | ######################################################################## |
---|
| 54 | # lecture des options de mymake |
---|
| 55 | ######################################################################## |
---|
| 56 | |
---|
[1279] | 57 | while (($# > 0)) |
---|
| 58 | do |
---|
| 59 | case $1 in |
---|
| 60 | "-h") cat <<fin |
---|
[783] | 61 | Usage : |
---|
[1772] | 62 | makelmdz_fcm [options] -arch nom_arch exec |
---|
| 63 | [-h] : brief help |
---|
| 64 | [-d [[IMx]JMx]LM] : IM, JM, LM are the dimensions in x, y, z (default: $dim) |
---|
| 65 | [-p PHYS] : set of physical parametrizations (in libf/phyPHYS), (default: lmd) |
---|
| 66 | [-prod / -dev / -debug] : compilation mode production (default) / developement / debug |
---|
| 67 | [-c false/MPI1/MPI2] : coupling with ocean model : MPI1/MPI2/false (default: false) |
---|
| 68 | [-v false/orchidee2.0/orchidee1.9/true] : version of the vegetation model to include (default: false) |
---|
| 69 | false : no vegetation model |
---|
| 70 | orchidee2.0 : compile using ORCHIDEE 2.0 (or more recent version) |
---|
| 71 | orchidee1.9 : compile using ORCHIDEE up to the version including OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6 |
---|
| 72 | true : (obsolete; for backward compatibility) use ORCHIDEE tag 1.9-1.9.6 |
---|
| 73 | [-chimie INCA/false] : with INCA chemistry model or without (default: false) |
---|
| 74 | [-parallel none/mpi/omp/mpi_omp] : parallelism (default: none) : mpi, openmp or mixted mpi_openmp |
---|
| 75 | [-g GRI] : grid configuration in dyn3d/GRI_xy.h (default: reg, inclues a zoom) |
---|
| 76 | [-io IO] : Input/Output library (default: ioipsl) |
---|
| 77 | [-include INCLUDES] : extra include path to add |
---|
| 78 | [-cpp CPP_KEY] : additional preprocessing definitions |
---|
| 79 | [-adjnt] : adjoint model, not operational ... |
---|
| 80 | [-mem] : reduced memory dynamics (if in parallel mode) |
---|
| 81 | [-filtre NOMFILTRE] : use filtre from libf/NOMFILTRE (default: filtrez) |
---|
| 82 | [-link LINKS] : additional links with other libraries |
---|
[1802] | 83 | [-j n] : active parallel compiling on ntask |
---|
| 84 | [-full] : full recompiling |
---|
[1772] | 85 | [-fcm_path path] : path to the fcm tool (default: tools/fcm/bin) |
---|
| 86 | [-ext_src path] : path to an additional set of routines to compile with the model |
---|
| 87 | -arch nom_arch : target architecture |
---|
| 88 | exec : executable to build |
---|
[783] | 89 | fin |
---|
[1279] | 90 | exit;; |
---|
[783] | 91 | |
---|
[1279] | 92 | "-d") |
---|
| 93 | dim=$2 ; shift ; shift ;; |
---|
| 94 | |
---|
| 95 | "-p") |
---|
| 96 | physique="$2" ; shift ; shift ;; |
---|
[783] | 97 | |
---|
[1279] | 98 | "-g") |
---|
| 99 | grille="$2" ; shift ; shift ;; |
---|
[783] | 100 | |
---|
[1279] | 101 | "-c") |
---|
| 102 | couple="$2" ; shift ; shift ;; |
---|
[783] | 103 | |
---|
[1279] | 104 | "-prod") |
---|
| 105 | compil_mod="prod" ; shift ;; |
---|
[1002] | 106 | |
---|
[1279] | 107 | "-dev") |
---|
| 108 | compil_mod="dev" ; shift ;; |
---|
[1002] | 109 | |
---|
[1279] | 110 | "-debug") |
---|
| 111 | compil_mod="debug" ; shift ;; |
---|
[1002] | 112 | |
---|
[1279] | 113 | "-io") |
---|
| 114 | io="$2" ; shift ; shift ;; |
---|
[783] | 115 | |
---|
[1279] | 116 | "-v") |
---|
| 117 | veget="$2" ; shift ; shift ;; |
---|
[783] | 118 | |
---|
[1279] | 119 | "-chimie") |
---|
| 120 | chimie="$2" ; shift ; shift ;; |
---|
[783] | 121 | |
---|
[1279] | 122 | "-parallel") |
---|
| 123 | parallel="$2" ; shift ; shift ;; |
---|
| 124 | |
---|
| 125 | "-include") |
---|
| 126 | INCLUDE="$INCLUDE -I$2" ; shift ; shift ;; |
---|
[783] | 127 | |
---|
[1279] | 128 | "-cpp") |
---|
| 129 | CPP_KEY="$CPP_KEY $2" ; shift ; shift ;; |
---|
[1132] | 130 | |
---|
[1279] | 131 | "-adjnt") |
---|
[1772] | 132 | echo "not operational ... work to be done here ";exit |
---|
[1279] | 133 | opt_dep="$opt_dep adjnt" ; adjnt="-ladjnt -ldyn3d " |
---|
| 134 | optim="$optim -Dadj" ; shift ;; |
---|
[783] | 135 | |
---|
[1279] | 136 | "-cosp") |
---|
| 137 | cosp="$2" ; shift ; shift ;; |
---|
[1680] | 138 | |
---|
| 139 | "-mem") |
---|
| 140 | paramem="mem" ; shift ;; |
---|
[783] | 141 | |
---|
[1279] | 142 | "-filtre") |
---|
| 143 | filtre=$2 ; shift ; shift ;; |
---|
[783] | 144 | |
---|
[1279] | 145 | "-link") |
---|
| 146 | LIB="$LIB $2" ; shift ; shift ;; |
---|
[1136] | 147 | |
---|
[1279] | 148 | "-fcm_path") |
---|
| 149 | fcm_path=$2 ; shift ; shift ;; |
---|
[783] | 150 | |
---|
[1279] | 151 | "-ext_src") |
---|
| 152 | EXT_SRC=$2 ; shift ; shift ;; |
---|
[1802] | 153 | "-j") |
---|
| 154 | job=$2 ; shift ; shift ;; |
---|
| 155 | "-full") |
---|
| 156 | full="-full" ; shift ;; |
---|
[783] | 157 | |
---|
[1279] | 158 | "-arch") |
---|
| 159 | arch=$2 ; shift ; shift ;; |
---|
[783] | 160 | |
---|
[1279] | 161 | *) |
---|
| 162 | code="$1" ; shift ;; |
---|
| 163 | esac |
---|
| 164 | done |
---|
| 165 | |
---|
[1136] | 166 | ############################################################### |
---|
[1755] | 167 | # path to fcm |
---|
[1136] | 168 | ############################################################### |
---|
[1755] | 169 | # handle case when provided path to fcm was given as a relative |
---|
| 170 | # path (from makelmdz_fcm script directory) and not an absolute path |
---|
| 171 | if [[ ${fcm_path:0:1} != "/" ]] ; then |
---|
| 172 | # prepend with makelmdz_fcm location |
---|
| 173 | fcm_path=$(cd $(dirname $0) ; pwd)"/"${fcm_path} |
---|
| 174 | fi |
---|
[783] | 175 | |
---|
[1757] | 176 | # add fcm_path to PATH |
---|
| 177 | export PATH=${fcm_path}:${PATH} |
---|
| 178 | |
---|
[1755] | 179 | echo "Path to fcm:" |
---|
| 180 | echo ${fcm_path} |
---|
[1136] | 181 | |
---|
[783] | 182 | ############################################################### |
---|
[1140] | 183 | # lecture des chemins propres à l'architecture de la machine # |
---|
[783] | 184 | ############################################################### |
---|
[1279] | 185 | rm -f .void_file |
---|
| 186 | echo > .void_file |
---|
[1327] | 187 | rm -rf .void_dir |
---|
| 188 | mkdir .void_dir |
---|
[1279] | 189 | rm -f arch.path |
---|
| 190 | ln -s arch/arch-${arch}.path ./arch.path |
---|
[783] | 191 | source arch.path |
---|
| 192 | |
---|
| 193 | ######################################################################## |
---|
| 194 | # Definition des clefs CPP, des chemins des includes et modules |
---|
| 195 | # et des libraries |
---|
| 196 | ######################################################################## |
---|
| 197 | |
---|
[1279] | 198 | if [[ "$compil_mod" == "prod" ]] |
---|
| 199 | then |
---|
| 200 | COMPIL_FFLAGS="%PROD_FFLAGS" |
---|
| 201 | elif [[ "$compil_mod" == "dev" ]] |
---|
| 202 | then |
---|
| 203 | COMPIL_FFLAGS="%DEV_FFLAGS" |
---|
| 204 | elif [[ "$compil_mod" == "debug" ]] |
---|
| 205 | then |
---|
| 206 | COMPIL_FFLAGS="%DEBUG_FFLAGS" |
---|
| 207 | fi |
---|
[783] | 208 | |
---|
[1279] | 209 | if [[ "$physique" != "nophys" ]] |
---|
| 210 | then |
---|
[1615] | 211 | #We'll use some physics |
---|
| 212 | CPP_KEY="$CPP_KEY CPP_PHYS" |
---|
| 213 | if [[ "${physique:0:3}" == "lmd" ]] |
---|
| 214 | then |
---|
| 215 | #For lmd physics, default planet type is Earth |
---|
[1279] | 216 | CPP_KEY="$CPP_KEY CPP_EARTH" |
---|
[1615] | 217 | fi |
---|
[1279] | 218 | fi |
---|
[783] | 219 | |
---|
[1279] | 220 | if [[ "$chimie" == "INCA" ]] |
---|
| 221 | then |
---|
| 222 | CPP_KEY="$CPP_KEY INCA" |
---|
| 223 | INCLUDE="$INCLUDE -I${INCA_INCDIR}" |
---|
| 224 | LIB="$LIB -L${INCA_LIBDIR} -lchimie" |
---|
| 225 | fi |
---|
[783] | 226 | |
---|
[1279] | 227 | if [[ "$couple" != "false" ]] |
---|
| 228 | then |
---|
| 229 | CPP_KEY="$CPP_KEY CPP_COUPLE" |
---|
| 230 | INCLUDE="$INCLUDE -I${OASIS_INCDIR}" |
---|
| 231 | LIB="$LIB -L${OASIS_LIBDIR} -lpsmile.${couple} -lmpp_io" |
---|
| 232 | fi |
---|
[783] | 233 | |
---|
[1279] | 234 | if [[ "$parallel" == "mpi" ]] |
---|
| 235 | then |
---|
| 236 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI" |
---|
| 237 | PARA_FFLAGS="%MPI_FFLAGS" |
---|
| 238 | PARA_LD="%MPI_LD" |
---|
| 239 | elif [[ "$parallel" == "omp" ]] |
---|
| 240 | then |
---|
| 241 | CPP_KEY="$CPP_KEY CPP_PARA CPP_OMP" |
---|
| 242 | PARA_FFLAGS="%OMP_FFLAGS" |
---|
| 243 | PARA_LD="%OMP_LD" |
---|
| 244 | elif [[ "$parallel" == "mpi_omp" ]] |
---|
| 245 | then |
---|
| 246 | CPP_KEY="$CPP_KEY CPP_PARA CPP_MPI CPP_OMP" |
---|
| 247 | PARA_FFLAGS="%MPI_FFLAGS %OMP_FFLAGS" |
---|
| 248 | PARA_LD="%MPI_LD %OMP_LD" |
---|
| 249 | fi |
---|
[783] | 250 | |
---|
[1279] | 251 | if [[ ( "$parallel" == "omp" || "$parallel" == "mpi_omp" ) \ |
---|
| 252 | && "$compil_mod" == "debug" ]] |
---|
| 253 | then |
---|
| 254 | echo "Usually, parallelization with OpenMP requires some optimization." |
---|
| 255 | echo "We suggest switching to \"-dev\"." |
---|
| 256 | fi |
---|
[783] | 257 | |
---|
[1811] | 258 | if [ "$veget" = "true" -o "$veget" = "orchidee1.9" -o "$veget" = "orchidee2.0" ] |
---|
[1279] | 259 | then |
---|
[1811] | 260 | #NB: option 'true': for backward compatibility. To be used with ORCHIDEE tag 1.9-1.9.6 |
---|
| 261 | # For this case, cpp flag ORCHIDEE_NOOPENMP must be added to the makelmdz_fcm arguments |
---|
| 262 | # option orchidee1.9 : Compile with ORCHIDEE version up to the inclusion of OpenMP in ORCHIDEE : tag 1.9-1.9.5(version AR5)-1.9.6 |
---|
[1279] | 263 | INCLUDE="${INCLUDE} -I${ORCH_INCDIR}" |
---|
[1772] | 264 | CPP_KEY="$CPP_KEY CPP_VEGET" |
---|
[1811] | 265 | # temporary, for Orchidee versions 1.9.* (before openmp activation) |
---|
| 266 | if [[ "$veget" == "orchidee1.9" ]] ; then |
---|
| 267 | CPP_KEY="$CPP_KEY ORCHIDEE_NOOPENMP" |
---|
| 268 | fi |
---|
| 269 | if [[ "$veget" == "orchidee2.0" ]] ; then |
---|
| 270 | orch_libs=orchidee |
---|
| 271 | else |
---|
| 272 | orch_libs="sechiba parameters stomate parallel orglob" |
---|
| 273 | fi |
---|
| 274 | LIB="${LIB} -L${ORCH_LIBDIR}" |
---|
| 275 | for lib in ${orch_libs} ; do |
---|
| 276 | if [ -f ${ORCH_LIBDIR}/lib${LIBPREFIX}$lib.a ] ; then |
---|
| 277 | LIB="${LIB} -l${LIBPREFIX}$lib " |
---|
| 278 | fi |
---|
| 279 | done |
---|
| 280 | elif [[ "$veget" != "false" ]] ; then |
---|
[1772] | 281 | echo "Option -v $veget does not exist" |
---|
| 282 | echo "Use ./makelmdz_fcm -h for more information" |
---|
| 283 | exit |
---|
[1279] | 284 | fi |
---|
[783] | 285 | |
---|
[1279] | 286 | if [[ $io == ioipsl ]] |
---|
| 287 | then |
---|
| 288 | CPP_KEY="$CPP_KEY CPP_IOIPSL" |
---|
| 289 | INCLUDE="$INCLUDE -I${IOIPSL_INCDIR}" |
---|
| 290 | LIB="$LIB -L${IOIPSL_LIBDIR} -l${LIBPREFIX}ioipsl" |
---|
| 291 | fi |
---|
| 292 | if [[ "$cosp" == "true" ]] |
---|
| 293 | then |
---|
| 294 | CPP_KEY="$CPP_KEY CPP_COSP" |
---|
[1327] | 295 | COSP_PATH="$LIBFGCM/cosp" |
---|
[1279] | 296 | # LIB="${LIB} -l${LIBPREFIX}cosp" |
---|
| 297 | fi |
---|
[783] | 298 | |
---|
[1551] | 299 | INCLUDE="$INCLUDE ${NETCDF_INCDIR}" |
---|
| 300 | LIB="$LIB ${NETCDF_LIBDIR}" |
---|
| 301 | |
---|
[783] | 302 | ######################################################################## |
---|
| 303 | # calcul du nombre de dimensions |
---|
| 304 | ######################################################################## |
---|
| 305 | |
---|
| 306 | |
---|
[1279] | 307 | dim_full=$dim |
---|
| 308 | dim=`echo $dim | sed -e 's/[^0-9]/ /g'` |
---|
| 309 | set $dim |
---|
| 310 | dimc=$# |
---|
[783] | 311 | echo calcul de la dimension |
---|
| 312 | echo dim $dim |
---|
| 313 | echo dimc $dimc |
---|
| 314 | |
---|
| 315 | |
---|
| 316 | ######################################################################## |
---|
| 317 | # Gestion des dimensions du modele. |
---|
[1114] | 318 | # on cree ou remplace le fichier des dimensions |
---|
[783] | 319 | ######################################################################## |
---|
| 320 | |
---|
[1695] | 321 | cd $LIBFGCM/grid |
---|
| 322 | if [[ -f dimensions.h ]] |
---|
| 323 | then |
---|
| 324 | echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' |
---|
| 325 | echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." |
---|
| 326 | echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," |
---|
| 327 | echo vous pouvez continuer en repondant oui. |
---|
| 328 | echo "Voulez-vous vraiment continuer?" |
---|
[1755] | 329 | echo "" |
---|
| 330 | echo "WARNING: you are probably already compiling the model somewhere else." |
---|
| 331 | echo "Wait until the first compilation is finished before launching this one." |
---|
| 332 | echo "If you are sure that you are not compiling elsewhere, just answer " |
---|
| 333 | echo "yes (or 'oui') to the question below to proceed." |
---|
| 334 | echo "Do you wish to continue?" |
---|
[1695] | 335 | read reponse |
---|
[1755] | 336 | if [[ $reponse == "oui" || $reponse == "yes" ]] |
---|
[1695] | 337 | then |
---|
[1696] | 338 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1695] | 339 | else |
---|
| 340 | exit |
---|
| 341 | fi |
---|
| 342 | fi |
---|
| 343 | |
---|
| 344 | |
---|
[783] | 345 | cd $LIBFGCM/grid/dimension |
---|
[1114] | 346 | ./makdim $dim |
---|
[783] | 347 | cat $LIBFGCM/grid/dimensions.h |
---|
| 348 | cd $LMDGCM |
---|
| 349 | |
---|
| 350 | |
---|
| 351 | ######################################################################## |
---|
| 352 | # Differentes dynamiques (3d, 2d, 1d) |
---|
| 353 | ######################################################################## |
---|
| 354 | |
---|
[1279] | 355 | dimension=`echo $dim | wc -w` |
---|
[783] | 356 | echo dimension $dimension |
---|
| 357 | |
---|
[1279] | 358 | if (( $dimension == 3 )) |
---|
| 359 | then |
---|
[783] | 360 | cd $LIBFGCM/grid |
---|
| 361 | \rm fxyprim.h |
---|
| 362 | cp -p fxy_${grille}.h fxyprim.h |
---|
[1279] | 363 | else |
---|
| 364 | echo "Probleme dans les dimensions de la dynamique !!" |
---|
| 365 | echo "Non reactive pour l'instant !!!" |
---|
| 366 | fi |
---|
[783] | 367 | |
---|
| 368 | ###################################################################### |
---|
| 369 | # Traitement special pour le nouveau rayonnement de Laurent Li. |
---|
| 370 | # ---> YM desactive pour le traitemement en parallele |
---|
| 371 | ###################################################################### |
---|
| 372 | |
---|
[1279] | 373 | #if [[ -f $libf/phy$physique/raddim.h ]] |
---|
| 374 | #then |
---|
| 375 | # if [[ -f $libf/phy$physique/raddim.$dimh.h ]] |
---|
| 376 | #then |
---|
[783] | 377 | # \rm -f $libf/phy$physique/raddim.h |
---|
| 378 | # cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h |
---|
| 379 | # echo $libf/phy$physique/raddim.$dimh.h |
---|
| 380 | # cat $libf/phy$physique/raddim.h |
---|
| 381 | # else |
---|
| 382 | # echo On peut diminuer la taille de l executable en creant |
---|
| 383 | # echo le fichier $libf/phy$physique/raddim.$dimh.h |
---|
| 384 | # \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h |
---|
[1279] | 385 | # fi |
---|
| 386 | #fi |
---|
[783] | 387 | |
---|
| 388 | ###################################################################### |
---|
| 389 | # Gestion du filtre qui n'existe qu'en 3d. |
---|
| 390 | ###################################################################### |
---|
| 391 | |
---|
[1279] | 392 | if (( `expr $dimc \> 2` == 1 )) |
---|
| 393 | then |
---|
| 394 | filtre="FILTRE=$filtre" |
---|
[783] | 395 | else |
---|
[1279] | 396 | filtre="FILTRE= L_FILTRE= " |
---|
| 397 | fi |
---|
[783] | 398 | echo MACRO FILTRE $filtre |
---|
| 399 | |
---|
| 400 | echo $dimc |
---|
| 401 | |
---|
| 402 | |
---|
| 403 | |
---|
| 404 | ###################################################################### |
---|
| 405 | # Creation du suffixe de la configuration |
---|
| 406 | ###################################################################### |
---|
| 407 | |
---|
| 408 | |
---|
[1279] | 409 | SUFF_NAME=_${dim_full} |
---|
| 410 | SUFF_NAME=${SUFF_NAME}_phy${physique} |
---|
[783] | 411 | |
---|
[1279] | 412 | if [[ "$parallel" != "none" ]] |
---|
| 413 | then |
---|
| 414 | SUFF_NAME=${SUFF_NAME}_para |
---|
[1680] | 415 | DYN=dyn${dimc}d${paramem} |
---|
| 416 | if [[ "$paramem" == "mem" ]] |
---|
| 417 | then |
---|
| 418 | SUFF_NAME=${SUFF_NAME}_${paramem} |
---|
| 419 | fi |
---|
[783] | 420 | else |
---|
[1279] | 421 | SUFF_NAME=${SUFF_NAME}_seq |
---|
| 422 | DYN=dyn${dimc}d |
---|
| 423 | fi |
---|
[783] | 424 | |
---|
[1772] | 425 | if [[ $veget != "false" ]] |
---|
[1279] | 426 | then |
---|
| 427 | SUFF_NAME=${SUFF_NAME}_orch |
---|
| 428 | fi |
---|
[783] | 429 | |
---|
[1279] | 430 | if [[ $couple != "false" ]] |
---|
| 431 | then |
---|
| 432 | SUFF_NAME=${SUFF_NAME}_couple |
---|
| 433 | fi |
---|
[783] | 434 | |
---|
[1279] | 435 | if [[ $chimie == "INCA" ]] |
---|
| 436 | then |
---|
| 437 | SUFF_NAME=${SUFF_NAME}_inca |
---|
| 438 | fi |
---|
[783] | 439 | |
---|
| 440 | cd $LMDGCM |
---|
[1279] | 441 | config_fcm="config.fcm" |
---|
[783] | 442 | rm -f $config_fcm |
---|
| 443 | touch $config_fcm |
---|
| 444 | rm -f bin/${code}${SUFF_NAME}.e |
---|
| 445 | rm -f arch.fcm |
---|
[1279] | 446 | rm -f arch.opt |
---|
[783] | 447 | |
---|
| 448 | echo "%ARCH $arch" >> $config_fcm |
---|
| 449 | echo "%INCDIR $INCLUDE" >> $config_fcm |
---|
| 450 | echo "%LIB $LIB" >> $config_fcm |
---|
| 451 | echo "%ROOT_PATH $PWD" >> $config_fcm |
---|
| 452 | echo "%LIBF $LIBFGCM" >> $config_fcm |
---|
| 453 | echo "%LIBO $LIBOGCM" >> $config_fcm |
---|
| 454 | echo "%DYN $DYN" >> $config_fcm |
---|
| 455 | echo "%PHYS phy${physique}" >> $config_fcm |
---|
[1327] | 456 | echo "%COSP $COSP_PATH" >> $config_fcm |
---|
[783] | 457 | echo "%CPP_KEY $CPP_KEY" >> $config_fcm |
---|
| 458 | echo "%EXEC $code" >> $config_fcm |
---|
| 459 | echo "%SUFF_NAME $SUFF_NAME" >> $config_fcm |
---|
[1002] | 460 | echo "%COMPIL_FFLAGS $COMPIL_FFLAGS" >> $config_fcm |
---|
| 461 | echo "%PARA_FFLAGS $PARA_FFLAGS" >> $config_fcm |
---|
| 462 | echo "%PARA_LD $PARA_LD" >> $config_fcm |
---|
[1279] | 463 | echo "%EXT_SRC $EXT_SRC" >> $config_fcm |
---|
[783] | 464 | |
---|
[1002] | 465 | |
---|
| 466 | |
---|
[1137] | 467 | ln -s arch/arch-${arch}.fcm arch.fcm |
---|
[1279] | 468 | if test -f arch/arch-${arch}.opt && [ $compil_mod = "prod" ] |
---|
| 469 | then |
---|
| 470 | ln -s arch/arch-${arch}.opt arch.opt |
---|
| 471 | else |
---|
| 472 | ln -s .void_file arch.opt |
---|
| 473 | fi |
---|
| 474 | |
---|
| 475 | |
---|
[1002] | 476 | rm -f $LIBOGCM/${arch}${SUFF_NAME}/.config/fcm.bld.lock |
---|
[1802] | 477 | ./build_gcm ${fcm_path} -j $job $full |
---|
[783] | 478 | |
---|
[1279] | 479 | rm -rf tmp_src |
---|
| 480 | rm -rf config |
---|
[783] | 481 | ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config config |
---|
| 482 | ln -s $LIBOGCM/${arch}${SUFF_NAME}/.config/tmp tmp_src |
---|
[1695] | 483 | |
---|
[1696] | 484 | if [[ -r $LIBFGCM/grid/dimensions.h ]] |
---|
[1695] | 485 | then |
---|
| 486 | # Cleanup: remove dimension.h file |
---|
[1696] | 487 | \rm -f $LIBFGCM/grid/dimensions.h |
---|
[1695] | 488 | fi |
---|