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