[524] | 1 | #!/bin/csh |
---|
| 2 | # |
---|
| 3 | # $Header$ |
---|
| 4 | # |
---|
| 5 | #set verbose echo |
---|
[714] | 6 | ######################################################################## |
---|
| 7 | # options par defaut pour la commande make |
---|
| 8 | ######################################################################## |
---|
| 9 | set dim="48x32x19" |
---|
| 10 | set physique=lmd |
---|
| 11 | set phys="PHYS=$physique" |
---|
[725] | 12 | set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I$(LIBF)/filtrez -I. ' |
---|
[714] | 13 | set ntrac = 4 |
---|
| 14 | set filtre=filtrez |
---|
| 15 | set grille=reg |
---|
| 16 | set couple=false |
---|
| 17 | set veget=false |
---|
| 18 | set chimie=false |
---|
| 19 | set psmile=false |
---|
| 20 | set parallel=false |
---|
| 21 | set vampir=false |
---|
| 22 | set OPT_STACK='-Wf,-init stack=nan' |
---|
| 23 | set OPT_STACK=' ' |
---|
| 24 | set OPTIMI='-C debug -eC ' |
---|
| 25 | set OPTIMI=' -ftrace ' |
---|
| 26 | set OPT_LINUX='-O3' |
---|
| 27 | set io=ioipsl |
---|
[524] | 28 | |
---|
[714] | 29 | set FC_LINUX=pgf90 |
---|
| 30 | |
---|
[524] | 31 | ######################################################################## |
---|
| 32 | # path a changer contenant les sources et les objets du modele |
---|
| 33 | ######################################################################## |
---|
| 34 | |
---|
| 35 | ###### VERSION LMDZ.4 |
---|
[714] | 36 | #set LMDGCM=/workdir/p86cozic/INCA_dev/LMDZ4 |
---|
| 37 | #setenv LIBOGCM $LMDGCM/libo |
---|
| 38 | set LMDGCM="`pwd`" |
---|
| 39 | #setenv LIBOGCM $LMDGCM/libo |
---|
| 40 | # |
---|
| 41 | setenv IOIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib |
---|
| 42 | setenv MODIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib |
---|
| 43 | setenv NCDFINC /distrib/local/netcdf/pgi_32bits/include |
---|
| 44 | setenv NCDFLIB /distrib/local/netcdf/pgi_32bits/lib/ |
---|
[524] | 45 | |
---|
| 46 | setenv localdir "`pwd`" |
---|
[714] | 47 | set MODIPSL=0 |
---|
| 48 | echo $localdir | grep modipsl >& /dev/null |
---|
| 49 | if ( ! $status ) then |
---|
| 50 | set MODIPSL=1 |
---|
| 51 | setenv LMDGCM $localdir |
---|
| 52 | cd ../.. |
---|
| 53 | setenv LIBOGCM "`pwd`/lib" |
---|
| 54 | setenv IOIPSLDIR $LIBOGCM |
---|
| 55 | setenv MODIPSLDIR $LIBOGCM |
---|
| 56 | cd $localdir |
---|
| 57 | if ( `hostname` == rhodes ) then |
---|
| 58 | set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 59 | set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
| 60 | else |
---|
| 61 | if ( `hostname` == nymphea0 ) then |
---|
| 62 | set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 63 | set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
| 64 | else if ( `hostname` == mercure ) then |
---|
| 65 | set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 66 | set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
[722] | 67 | else if ( `hostname` == brodie ) then |
---|
| 68 | set NCDFINC=`grep sx8brodie ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` |
---|
| 69 | set NCDFLIB=`grep sx8brodie ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` |
---|
[714] | 70 | else |
---|
| 71 | echo 'Probleme de definition des variables NCDFINC et NCDFLIB' |
---|
| 72 | endif |
---|
| 73 | endif |
---|
| 74 | else |
---|
[524] | 75 | if ( ! $?LMDGCM ) then |
---|
| 76 | echo You must initialize the variable LMDGCM in your environnement |
---|
| 77 | echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc |
---|
| 78 | exit |
---|
| 79 | endif |
---|
| 80 | if ( ! $?LIBOGCM ) then |
---|
| 81 | set LIBOGCM=$LMDGCM/libo |
---|
| 82 | endif |
---|
| 83 | if ( ! $?IOIPSLDIR ) then |
---|
| 84 | echo You must initialize the variable IOIPSLDIR in your environnement |
---|
| 85 | echo for instance: "setenv IOIPSLDIR /usr/myself/ioipsl" in .cshrc |
---|
| 86 | exit |
---|
[714] | 87 | else |
---|
| 88 | setenv MODIPSLDIR $IOIPSLDIR |
---|
[524] | 89 | endif |
---|
| 90 | if ( ! $?NCDFLIB ) then |
---|
| 91 | echo You must initialize the variable NCDFLIB in your environnement |
---|
| 92 | echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc |
---|
| 93 | exit |
---|
| 94 | endif |
---|
| 95 | if ( ! $?NCDFINC ) then |
---|
| 96 | echo You must initialize the variable NCDFINC in your environnement |
---|
| 97 | echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc |
---|
| 98 | exit |
---|
| 99 | endif |
---|
| 100 | endif |
---|
| 101 | set model=$LMDGCM |
---|
| 102 | set libo=$LIBOGCM |
---|
[714] | 103 | |
---|
| 104 | ######################################################################## |
---|
| 105 | # Les differentes platformes reconnues |
---|
| 106 | ######################################################################## |
---|
| 107 | |
---|
| 108 | set HP=0 |
---|
| 109 | set IBM=0 |
---|
| 110 | set SUN=0 |
---|
| 111 | set VPP=0 |
---|
| 112 | set CRAY=0 |
---|
| 113 | set DEC=0 |
---|
| 114 | set LINUX=0 |
---|
| 115 | set NEC=0 |
---|
| 116 | set XNEC=0 |
---|
| 117 | set X6NEC=0 |
---|
[722] | 118 | set X8BRODIE=0 |
---|
[714] | 119 | if ( `uname` == HP-UX ) then |
---|
| 120 | set machine=HP |
---|
| 121 | set HP=1 |
---|
| 122 | else if (`uname` == UNIX_System_V ) then |
---|
| 123 | set machine=VPP |
---|
| 124 | set VPP=1 |
---|
| 125 | else if (`uname` == SunOS ) then |
---|
| 126 | set machine=SUN |
---|
| 127 | set SUN=1 |
---|
| 128 | else if ( `uname` == AIX ) then |
---|
| 129 | set machine=IBM |
---|
| 130 | set IBM=1 |
---|
| 131 | else if ( `uname` == OSF1 ) then |
---|
| 132 | set machine=ALPHA |
---|
| 133 | set DEC=1 |
---|
[722] | 134 | else if ( `uname` == Linux && `hostname` != mercure && `hostname` != brodie ) then |
---|
[714] | 135 | set machine=LINUX |
---|
| 136 | set LINUX=1 |
---|
| 137 | else if ( `hostname` == atlas || `hostname` == axis || `hostname` == etoile ) then |
---|
| 138 | set machine=CRAY |
---|
| 139 | set CRAY=1 |
---|
| 140 | else if ( `uname` == SUPER-UX ) then |
---|
| 141 | set machine=NEC |
---|
| 142 | set NEC=1 |
---|
| 143 | else if ( `hostname` == rhodes) then |
---|
| 144 | set machine=XNEC |
---|
| 145 | set XNEC=1 |
---|
| 146 | else if ( `hostname` == mercure) then |
---|
| 147 | set machine=X6NEC |
---|
| 148 | set X6NEC=1 |
---|
[722] | 149 | else if ( `hostname` == brodie) then |
---|
| 150 | set machine=X8BRODIE |
---|
| 151 | set X8BRODIE=1 |
---|
[714] | 152 | else |
---|
| 153 | echo Vous travaillez sur une machine non prevue par le reglement |
---|
| 154 | exit |
---|
| 155 | endif |
---|
| 156 | |
---|
[524] | 157 | if ( ! -d $libo ) then |
---|
| 158 | mkdir $libo |
---|
| 159 | endif |
---|
| 160 | |
---|
[714] | 161 | |
---|
| 162 | if $VPP then |
---|
| 163 | set netcdf=netcdf_v |
---|
| 164 | else |
---|
| 165 | set netcdf=netcdf |
---|
| 166 | endif |
---|
[524] | 167 | ######################################################################## |
---|
| 168 | # Quelques initialisations de variables du shell. |
---|
| 169 | ######################################################################## |
---|
| 170 | |
---|
| 171 | set dyn= |
---|
| 172 | set opt_link="" |
---|
| 173 | set adjnt="" |
---|
| 174 | set opt_dep="" |
---|
[714] | 175 | set libchimie="" |
---|
[524] | 176 | |
---|
| 177 | set optim="" |
---|
| 178 | set optimbis="" |
---|
| 179 | set optim90="" |
---|
| 180 | set oplink="" |
---|
| 181 | |
---|
| 182 | ######################################################################## |
---|
[714] | 183 | # Optimisations par defaut suivant les machines |
---|
[524] | 184 | ######################################################################## |
---|
| 185 | |
---|
[714] | 186 | echo "Optimisations par defaut suivant les machines" |
---|
| 187 | set libf=$model/libf |
---|
| 188 | #setenv localdir "LOCAL_DIR=`pwd`" |
---|
| 189 | #setenv localdir "`pwd`" |
---|
| 190 | cd $model |
---|
| 191 | ############# |
---|
| 192 | if $CRAY then |
---|
| 193 | ############# |
---|
| 194 | # set optim="-Wf'-ei' -dp -Wf'-a static'" |
---|
| 195 | set optimbis=" -DCRAY " |
---|
| 196 | set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv ' |
---|
| 197 | set optim="$optim90" |
---|
| 198 | set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 199 | set mod_loc_dir=" " |
---|
| 200 | set mod_suffix=" " |
---|
| 201 | ################# |
---|
| 202 | else if $SUN then |
---|
| 203 | ################# |
---|
| 204 | set optim=" -fast " |
---|
| 205 | set optimbis=" " |
---|
| 206 | set optim90=" -fast -fixed " |
---|
| 207 | set optimtru90=" -fast -free " |
---|
| 208 | set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 209 | set mod_loc_dir=$localdir |
---|
| 210 | set mod_suffix=mod |
---|
| 211 | ################# |
---|
| 212 | else if $HP then |
---|
| 213 | ################# |
---|
| 214 | set optim=" +U77 -O +E1 " |
---|
| 215 | set optimbis=" " |
---|
| 216 | ################# |
---|
| 217 | else if $IBM then |
---|
| 218 | ################# |
---|
| 219 | set optim=" -O3 -qtune=pwr2 -qarch=pwr2" |
---|
| 220 | set optimbis=" " |
---|
| 221 | ################# |
---|
| 222 | else if $VPP then |
---|
| 223 | ################# |
---|
| 224 | # set optim="-Dasuxm -On, -g -Ad -Potilax -Eciplume -Si" |
---|
| 225 | # set optimbis=" -Wv,-m3 -Wp,-DVPP -Z $LMDGCM/listage" |
---|
| 226 | set optimbis=" -Wp,-DNC_DOUBLE -Ad -Z $LMDGCM/listage -X9" |
---|
| 227 | set optim90="$optim $optimbis -X9 -w" |
---|
| 228 | set mod_loc_dir=$MODIPSLDIR |
---|
| 229 | set mod_suffix=mod |
---|
| 230 | ################# |
---|
| 231 | else if $DEC then |
---|
| 232 | ################# |
---|
| 233 | set optim=" " |
---|
| 234 | set optimbis=" " |
---|
| 235 | ################# |
---|
| 236 | else if $LINUX then |
---|
| 237 | ################# |
---|
| 238 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 239 | set optim="-fast " |
---|
| 240 | set optim90=" -fast " |
---|
| 241 | # set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR " |
---|
| 242 | set optimtru90=" -fast -c -Mfree " |
---|
| 243 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 244 | set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " |
---|
| 245 | set optim90=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " |
---|
| 246 | set optimtru90=" $OPT_LINUX -fno-second-underscore -ffree-form -fstatic " |
---|
| 247 | else |
---|
| 248 | echo 'compilateur linux non reconnu' |
---|
| 249 | exit |
---|
| 250 | endif |
---|
| 251 | set mod_loc_dir=$MODIPSLDIR |
---|
| 252 | set mod_suffix=mod |
---|
| 253 | ################# |
---|
| 254 | else if $NEC then |
---|
| 255 | ################# |
---|
| 256 | set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' |
---|
| 257 | set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' |
---|
| 258 | set optim="$optim90" |
---|
| 259 | set optimbis=" " |
---|
| 260 | set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl $NCDFLIB -lnetcdf_i8r8_v " |
---|
| 261 | set mod_loc_dir="." |
---|
| 262 | set mod_suffix="mod" |
---|
| 263 | ################# |
---|
| 264 | else if $XNEC then |
---|
| 265 | ################# |
---|
| 266 | set optdbl='-dw -Wf\"-A dbl4\"' |
---|
| 267 | set optim90=' -clear -float0 -f3 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' |
---|
| 268 | set optimtru90=' -clear -f4 -float0 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' |
---|
| 269 | set optim="$optim90" |
---|
| 270 | set optimbis=" " |
---|
| 271 | set mod_suffix="mod" |
---|
| 272 | set mod_loc_dir="./" |
---|
| 273 | ################# |
---|
| 274 | else if $X6NEC then |
---|
| 275 | ################# |
---|
| 276 | set optdbl='-dw -Wf\"-A dbl4\"' |
---|
| 277 | set optim90=' -clear -float0 -f3 -size_t64 -P stack -Wf "-init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' |
---|
| 278 | set optimtru90=' -clear -f4 -float0 -size_t64 -P stack -Wf "-init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' |
---|
| 279 | set optim="$optim90" |
---|
| 280 | set optimbis=" " |
---|
| 281 | set mod_suffix="mod" |
---|
| 282 | set mod_loc_dir="./" |
---|
[722] | 283 | ################# |
---|
| 284 | else if $X8BRODIE then |
---|
[732] | 285 | ################## |
---|
[722] | 286 | set optdbl='-dw -Wf\"-A dbl4\"' |
---|
[732] | 287 | # set optim90='-P stack -Wf,-pvctl res=whole,-A dbl4,-init stack=nan,-init heap=nan,-ptr byte -EP -R5 -float0 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume" -I/SX/usr/include' |
---|
| 288 | set optim90='-P stack -Wf,-pvctl res=whole,-A dbl4,-ptr byte -EP -R5 -float0 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume" -I/SX/usr/include' |
---|
| 289 | set optimtru90="$optim90" |
---|
| 290 | set optim90="$optim90" |
---|
[722] | 291 | set optim="$optim90" |
---|
| 292 | set optimbis=" " |
---|
| 293 | set mod_suffix="mod" |
---|
| 294 | set mod_loc_dir="./" |
---|
[714] | 295 | else |
---|
| 296 | set optim="" |
---|
| 297 | set optimbis=" " |
---|
| 298 | endif |
---|
[524] | 299 | |
---|
[714] | 300 | set nomlib=$machine |
---|
[524] | 301 | |
---|
| 302 | ######################################################################## |
---|
| 303 | # lecture des options de mymake |
---|
| 304 | ######################################################################## |
---|
| 305 | |
---|
| 306 | top: |
---|
| 307 | if ($#argv > 0) then |
---|
| 308 | switch ($1:q) |
---|
| 309 | |
---|
| 310 | case -h: |
---|
| 311 | |
---|
| 312 | ######################################################################## |
---|
| 313 | # Manuel en ligne |
---|
| 314 | ######################################################################## |
---|
| 315 | more <<eod |
---|
| 316 | |
---|
| 317 | |
---|
| 318 | makegcm [Options] prog |
---|
| 319 | |
---|
| 320 | |
---|
| 321 | |
---|
| 322 | |
---|
| 323 | Par default, la commande makegcm: |
---|
| 324 | --------------------------------- |
---|
| 325 | |
---|
| 326 | 1. compile une serie de sous programmes se trouvant dans des sous-repertoires |
---|
| 327 | de $LMDGCM/libf. |
---|
| 328 | Les sous programmes sont ensuite stokes sur dans des librairies FORTRAN |
---|
| 329 | sur $LIBOGCM. |
---|
| 330 | |
---|
| 331 | 2. Ensuite, makegcm compile le programme prog.f se trouvant par default sur |
---|
| 332 | $LMDGCM/libf/dyn3d et effectue le lien avec l ensemble des librairies. |
---|
| 333 | |
---|
| 334 | La variable '$LMDGCM' doit etre initialisee dans votre .cshrc ou en dur |
---|
| 335 | dans la comande makegcm. |
---|
| 336 | |
---|
| 337 | La commande makegcm est faite pour permettre de gerer en parallele des |
---|
| 338 | versions differentes du modele, compilees avec des options de compilation |
---|
| 339 | et des dimensions differentes sans avoir a chaque fois a recompiler tout |
---|
| 340 | le modele. |
---|
| 341 | |
---|
| 342 | Les librairies FORTRAN sont stoquees sur le directory $LIBOGCM. |
---|
| 343 | |
---|
| 344 | |
---|
| 345 | OPTIONS: |
---|
| 346 | -------- |
---|
| 347 | |
---|
| 348 | Les options suivantes peuvent etre definies soit par defaut en editant le |
---|
| 349 | "script" makegcm, soit en interactif: |
---|
| 350 | |
---|
| 351 | -d imxjmxlm ou im, jm, et lm sont resp. le nombre de longitudes, latitudes |
---|
| 352 | et couches verticales. |
---|
| 353 | |
---|
| 354 | -t ntrac selectionne le nombre de traceur advectes par la dynamique. |
---|
| 355 | Dans les versions courantes du modele terrestre on a par exemple |
---|
| 356 | ntrac=2 pour l'eau vapeur et liquide |
---|
| 357 | |
---|
| 358 | L'effet des options -d et -t est d'ecraser le fichier |
---|
| 359 | $LMDGCM/libf/grid/dimensions.h |
---|
| 360 | qui contient sous forme de 4 PARAMETER FORTRAN les 3 dimensions |
---|
| 361 | de la grille horizontale im, jm, lm plus le nombre de traceurs |
---|
| 362 | advectes passivement par la dynamique ntrac, par un nouveu fichier |
---|
| 363 | $LMDGCM/libf/grid/dimension/dimensions.im.jm.lm.tntrac |
---|
| 364 | Si ce fichier n'existe pas encore, il est cree par le script |
---|
| 365 | $LMDGCM/libf/grid/dimension/makdim |
---|
| 366 | |
---|
| 367 | -p PHYS pour selectionner le jeu de parametrisations physiques avec |
---|
| 368 | lequel on veut compiler le modele. |
---|
| 369 | Le modele sera alors compile en prenant les sources des |
---|
| 370 | parametrisations physiques dans le repertoire: |
---|
| 371 | $LMDGCM/libf/phyPHYS |
---|
| 372 | |
---|
| 373 | -c false|true |
---|
| 374 | pour selectionner le mode force (par defaut) ou couple |
---|
| 375 | |
---|
| 376 | -io ioipsl|noioipsl |
---|
| 377 | pour selectionner le logiciel IO : IOIPSL par defaut |
---|
| 378 | |
---|
| 379 | -psmile false|true |
---|
| 380 | pour selectionner le mode psmile ou non (par defaut) |
---|
| 381 | |
---|
[714] | 382 | -parallel false|true |
---|
| 383 | pour selectionner le mode parallele ou non (false par defaut) |
---|
| 384 | |
---|
[524] | 385 | -v true|false |
---|
| 386 | pour selectionner la vegetation (par defaut) ou non |
---|
| 387 | |
---|
[714] | 388 | -chimie CH4|CH4_AER|NMHC|NMHC_AER|AER|GES|false |
---|
| 389 | pour selectionner ou non la chimie (par defaut sans) |
---|
| 390 | |
---|
[524] | 391 | -g grille selectionne le type de grille qu'on veut utiliser. |
---|
| 392 | L'effet de cette option est d'ecraser le fichier |
---|
| 393 | $LMDGCM/libf/grid/fxyprim.h |
---|
| 394 | avec le fichier |
---|
| 395 | $LMDGCM/libf/grid/fxy_grille.h |
---|
| 396 | grille peut prendre les valeurs: |
---|
| 397 | 1. reg pour la grille reguliere |
---|
| 398 | 2. sin pour avoir des points equidistants en sinus de la latitude |
---|
| 399 | 3. new pour pouvoir zoomer sur une partie du globe |
---|
| 400 | |
---|
| 401 | -O "optimisation fortran" ou les optimisations fortran sont les options de la |
---|
| 402 | commande f77 |
---|
| 403 | |
---|
| 404 | -include path |
---|
| 405 | Dans le cas ou on a dans des sous programmes des fichiers |
---|
| 406 | #include (cpp) qui se trouve sur des repertoires non references |
---|
| 407 | par defaut |
---|
| 408 | |
---|
| 409 | -adjnt Pour compiler la l'adjoint du code dynamique |
---|
| 410 | |
---|
| 411 | -filtre filtre |
---|
| 412 | Pour choisir le filtre en longitude dans les regions polaires. |
---|
| 413 | "filtre" correspond au nom d'un repertoire se trouvant sur |
---|
| 414 | $LMDGCM/libf. Le filtre standard du modele est "filtrez" qui peut |
---|
| 415 | etre utilise aussi bien pour une grille reguliere que pour une |
---|
| 416 | grille zoomee en longitude. |
---|
| 417 | |
---|
| 418 | -link "-Ldir1 -lfile1 -Ldir2 -lfile2 ..." |
---|
| 419 | Pour rajouter un lien avec les librairies FORTRAN |
---|
| 420 | libfile1.a, libfile2.a ... se trouvant respectivement sur les |
---|
| 421 | repertoires dir1, dir2 ... |
---|
| 422 | Si dirn est un repertoire dont le chemin est automatique (comme |
---|
| 423 | par exemple /usr/lib ...) il n'est pas besoin de specifier -Ldirn. |
---|
| 424 | |
---|
| 425 | Auteur: Frederic Hourdin (hourdin@lmd.jussieu.fr) |
---|
| 426 | eod |
---|
| 427 | exit |
---|
| 428 | |
---|
| 429 | ######################################################################## |
---|
| 430 | # Lecture des differentes options |
---|
| 431 | ######################################################################## |
---|
| 432 | |
---|
| 433 | case -d: |
---|
| 434 | set dim=$2 ; shift ; shift ; goto top |
---|
| 435 | |
---|
| 436 | case -O: |
---|
| 437 | set optim="$2" ; shift ; shift ; goto top |
---|
| 438 | |
---|
| 439 | case -p |
---|
| 440 | set physique="$2" ; set phys="PHYS=$physique" ; shift ; shift ; goto top |
---|
| 441 | |
---|
| 442 | case -g |
---|
| 443 | set grille="$2" ; shift ; shift ; goto top |
---|
| 444 | |
---|
| 445 | case -c |
---|
| 446 | set couple="$2" ; shift ; shift ; goto top |
---|
| 447 | |
---|
| 448 | case -io |
---|
| 449 | set io="$2" ; shift ; shift ; goto top |
---|
| 450 | |
---|
| 451 | case -v |
---|
| 452 | set veget="$2" ; shift ; shift ; goto top |
---|
| 453 | |
---|
| 454 | case -psmile |
---|
[714] | 455 | set psmile="$2" |
---|
| 456 | if ( "$psmile" == 'true' ) then |
---|
| 457 | set couple='true' |
---|
| 458 | endif |
---|
| 459 | shift ; shift ; goto top |
---|
| 460 | |
---|
| 461 | case -chimie |
---|
| 462 | set chimie="$2" ; shift ; shift ; goto top |
---|
| 463 | |
---|
| 464 | case -parallel |
---|
| 465 | set parallel="$2" ; shift ; shift ; goto top |
---|
[524] | 466 | |
---|
| 467 | case -t |
---|
| 468 | set ntrac=$2 ; shift ; shift ; goto top |
---|
| 469 | |
---|
| 470 | case -include |
---|
| 471 | set include="$include -I$2" ; shift ; shift ; goto top |
---|
| 472 | |
---|
| 473 | case -adjnt |
---|
| 474 | set opt_dep="$opt_dep adjnt" ; set adjnt="-ladjnt -ldyn3d " |
---|
| 475 | set optim="$optim -Dadj" ; shift ; goto top |
---|
| 476 | |
---|
| 477 | case -filtre |
---|
| 478 | set filtre=$2 ; shift ; shift ; goto top |
---|
| 479 | |
---|
| 480 | case -link |
---|
| 481 | set opt_link="$opt_link $2" ; shift ; shift ; goto top |
---|
| 482 | |
---|
| 483 | case -debug |
---|
[714] | 484 | if $HP then |
---|
| 485 | set optim=" -g " |
---|
| 486 | else if $SUN then |
---|
| 487 | setenv PARALLEL 2 |
---|
| 488 | # Il faut rajouter l'option -dalign a -g pour pouvoir editer les liens |
---|
| 489 | # avec des programmes compiles avec -fast |
---|
| 490 | set optim=" -g -dalign " |
---|
| 491 | set optim90=" -fixed -g " |
---|
| 492 | set optimtru90=" -free -g -C -dalign " |
---|
| 493 | else if $CRAY then |
---|
| 494 | set optim="$optim"" -g " |
---|
| 495 | set optim90="$optim90"" -G1 " |
---|
| 496 | else if $LINUX then |
---|
| 497 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 498 | set optim="$optim"" -g -C -Mbounds " |
---|
| 499 | set optim90="$optim90"" -g -C -Mbounds " |
---|
| 500 | set optimtru90="$optimtru90"" -g -C -Mbounds " |
---|
| 501 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 502 | set optim="$optim"" -g -fbounds-check " |
---|
| 503 | set optim90="$optim90"" -g -fbounds-check " |
---|
| 504 | set optimtru90="$optimtru90"" -g -fbounds-check " |
---|
| 505 | else |
---|
| 506 | echo 'compilateur linux non reconnu' |
---|
| 507 | exit |
---|
| 508 | endif |
---|
[524] | 509 | else |
---|
| 510 | echo pas d option debug predefinie pour cette machine |
---|
| 511 | exit |
---|
| 512 | endif |
---|
| 513 | shift ; goto top |
---|
| 514 | |
---|
| 515 | default |
---|
| 516 | set code="$1" ; shift ; goto top |
---|
| 517 | |
---|
| 518 | endsw |
---|
| 519 | endif |
---|
| 520 | |
---|
| 521 | ######################################################################## |
---|
| 522 | # Definition des clefs CPP |
---|
| 523 | ######################################################################## |
---|
| 524 | |
---|
[714] | 525 | set cppflags='' |
---|
| 526 | |
---|
[732] | 527 | if $X8BRODIE then |
---|
| 528 | set cppflags="$cppflags -DNC_DOUBLE -DBLAS -DSGEMV=DGEMV -DSGEMM=DGEMM" |
---|
| 529 | endif |
---|
| 530 | |
---|
[524] | 531 | if ( $io == ioipsl ) then |
---|
[714] | 532 | set cppflags="$cppflags -DCPP_IOIPSL" |
---|
[524] | 533 | endif |
---|
| 534 | |
---|
| 535 | if ( "$physique" == 'nophys' ) then |
---|
| 536 | set phys="L_PHY= LIBPHY=" |
---|
| 537 | else |
---|
[714] | 538 | set cppflags="$cppflags -DCPP_PHYS" |
---|
[524] | 539 | endif |
---|
| 540 | |
---|
[714] | 541 | set link_veget=" " |
---|
| 542 | if ( "$veget" == 'true' ) then |
---|
| 543 | set cppflags="$cppflags -DCPP_VEGET" |
---|
| 544 | set link_veget=" -lsechiba -lparameters -lstomate" |
---|
| 545 | if ( $XNEC ) then |
---|
| 546 | set link_veget=" -lsxsechiba -lsxparameters -lsxstomate" |
---|
| 547 | endif |
---|
| 548 | endif |
---|
[524] | 549 | |
---|
[714] | 550 | if ( "$chimie" == 'CH4' ) then |
---|
| 551 | set cppflags="$cppflags -DINCA -DINCA_CH4 " |
---|
| 552 | else if ( "$chimie" == 'CH4_AER' ) then |
---|
| 553 | set cppflags="$cppflags -DINCA -DINCA_CH4 -DINCA_AER" |
---|
| 554 | else if ( "$chimie" == 'NMHC' ) then |
---|
| 555 | set cppflags="$cppflags -DINCA -DINCA_NMHC " |
---|
| 556 | else if ( "$chimie" == 'NMHC_AER' ) then |
---|
| 557 | set cppflags="$cppflags -DINCA -DINCA_NMHC -DINCA_AER" |
---|
| 558 | else if ( "$chimie" == 'AER' ) then |
---|
| 559 | set cppflags="$cppflags -DINCA -DINCA_AER" |
---|
| 560 | else if ("$chimie" == 'GES' ) then |
---|
| 561 | set cppflags="$cppflags -DINCA" |
---|
[669] | 562 | endif |
---|
[714] | 563 | if ( "$chimie" == 'CH4' || "$chimie" == 'CH4_AER' || "$chimie" == 'NMHC' || "$chimie" == 'NMHC_AER' || "$chimie" == 'AER' || "$chimie" == 'GES' ) then |
---|
| 564 | set opt_dep="$opt_dep chimie" |
---|
| 565 | set libchimie="-lchimie" |
---|
| 566 | if ( $XNEC || $X6NEC ) then |
---|
| 567 | set libchimie="-lsxchimie" |
---|
| 568 | endif |
---|
| 569 | endif |
---|
| 570 | |
---|
| 571 | if ( "$couple" == 'true' ) then |
---|
| 572 | set cppflags="$cppflags -DCPP_COUPLE" |
---|
| 573 | endif |
---|
[664] | 574 | |
---|
[714] | 575 | if ( "$psmile" == 'true' ) then |
---|
| 576 | set cppflags="$cppflags -DCPP_PSMILE" |
---|
| 577 | endif |
---|
| 578 | |
---|
| 579 | set FLAG_PARA='' |
---|
| 580 | if ( "$parallel" == 'true' ) then |
---|
[722] | 581 | set cppflags="$cppflags -DCPP_PARA" |
---|
[725] | 582 | set FLAG_PARA='par' |
---|
[714] | 583 | endif |
---|
| 584 | |
---|
| 585 | set optim="$optim $cppflags" |
---|
| 586 | set optim90="$optim90 $cppflags" |
---|
| 587 | set optimtru90="$optimtru90 $cppflags" |
---|
| 588 | |
---|
| 589 | |
---|
[524] | 590 | ######################################################################## |
---|
| 591 | # cas special sans physique |
---|
| 592 | ######################################################################## |
---|
| 593 | if ( "$physique" == 'nophys' ) then |
---|
| 594 | set phys="L_PHY= LIBPHY=" |
---|
| 595 | endif |
---|
| 596 | |
---|
| 597 | ######################################################################## |
---|
| 598 | # choix du nombre de traceur par defaut si il n'a pas ete choisi, |
---|
| 599 | # suivant la physique |
---|
| 600 | ######################################################################## |
---|
| 601 | |
---|
| 602 | if ( $ntrac == 0 ) then |
---|
| 603 | if ( "$physique" == 'nophys' ) then |
---|
| 604 | set ntrac=1 |
---|
| 605 | else if ( "$physique" == 'lmd' ) then |
---|
| 606 | set ntrac=2 |
---|
| 607 | else if ( "$physique" == 'lmd_test_li' ) then |
---|
| 608 | set ntrac=2 |
---|
| 609 | else if ( "$physique" == 'ec' ) then |
---|
| 610 | set ntrac=1 |
---|
| 611 | else |
---|
| 612 | set ntrac = 1 |
---|
| 613 | endif |
---|
| 614 | endif |
---|
| 615 | |
---|
| 616 | ######################################################################## |
---|
| 617 | #subtilites sur le nom de la librairie |
---|
| 618 | ######################################################################## |
---|
| 619 | |
---|
| 620 | \rm -f tmp ; touch tmp |
---|
| 621 | \rm -f tmp90 ; touch tmp90 |
---|
| 622 | foreach i ( $optim ) |
---|
| 623 | echo $i | sed -e 's/\"//g' -e "s/\'//g" -e 's/-//g' >> tmp |
---|
| 624 | end |
---|
| 625 | set suf= |
---|
| 626 | foreach i ( `sort tmp | uniq ` ) |
---|
| 627 | set suf=$suf$i |
---|
| 628 | end |
---|
[714] | 629 | if ( ! $IBM ) then |
---|
| 630 | set nomlib="$nomlib$suf" |
---|
| 631 | endif |
---|
| 632 | if ( $DEC ) then |
---|
| 633 | set nomlib=DEC |
---|
| 634 | endif |
---|
| 635 | if ( $IBM ) then |
---|
| 636 | set dim=`echo $dim | sed -en 's/[^0-9]/ /g'` |
---|
| 637 | set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'` |
---|
| 638 | else if ( $SUN ) then |
---|
| 639 | set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` |
---|
| 640 | set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` |
---|
| 641 | else |
---|
[524] | 642 | set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'` |
---|
| 643 | set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'` |
---|
[714] | 644 | endif |
---|
| 645 | set nomlib=${nomlib}${physique}_${dim_}_t${ntrac}_$grille |
---|
| 646 | ## M-A-F nomlib trop long sur CRAY pour ar |
---|
| 647 | if ( $CRAY ) then |
---|
| 648 | set nomlib=F90_${dim_}_t${ntrac} |
---|
| 649 | endif |
---|
[722] | 650 | if ( $NEC || $XNEC || $X6NEC || $X8BRODIE ) then |
---|
[714] | 651 | set nomlib=F90_${dim_}_t${ntrac} |
---|
| 652 | endif |
---|
[524] | 653 | echo calcul de la dimension |
---|
| 654 | set dimc=`echo $dim | wc -w` |
---|
| 655 | |
---|
| 656 | if ( "$dimc" == "2" ) then |
---|
| 657 | set include="$include "'-I$(LIBF)/dyn2d ' |
---|
| 658 | set dimh=$dim |
---|
| 659 | else |
---|
[714] | 660 | set include="$include "'-I$(LIBF)/dyn3d ' |
---|
[524] | 661 | set dimh=`echo $dim | awk ' { print $1 "." $2 } '` |
---|
| 662 | endif |
---|
| 663 | echo $dimc |
---|
| 664 | |
---|
| 665 | ######################################################################## |
---|
| 666 | # path pour les #include |
---|
| 667 | ######################################################################## |
---|
| 668 | |
---|
[714] | 669 | if ( $XNEC ) then |
---|
[524] | 670 | set include="$include -I$NCDFINC -I$IOIPSLDIR" |
---|
[714] | 671 | else |
---|
| 672 | set include="$include -I$NCDFINC -I$IOIPSLDIR" |
---|
| 673 | endif |
---|
| 674 | echo $include |
---|
[524] | 675 | |
---|
| 676 | ######################################################################## |
---|
| 677 | # Gestion des dimensions du modele. |
---|
| 678 | # on cree ou remplace le fichier des dimensions/nombre de traceur |
---|
| 679 | ######################################################################## |
---|
| 680 | |
---|
| 681 | cd $libf/grid |
---|
| 682 | if ( -f dimensions.h ) then |
---|
| 683 | echo 'ATTENTION: vous etes sans doute en train de compiler le modele par ailleurs' |
---|
| 684 | echo "Attendez que la premiere compilation soit terminee pour relancer la suivante." |
---|
| 685 | echo "Si vous etes sur que vous ne compilez pas le modele par ailleurs," |
---|
| 686 | echo vous pouvez continuer en repondant oui. |
---|
| 687 | echo "Voulez-vous vraiment continuer?" |
---|
| 688 | if ( $< == "oui" ) then |
---|
| 689 | \rm -f $libf/grid/dimensions.h |
---|
| 690 | else |
---|
| 691 | exit |
---|
| 692 | endif |
---|
| 693 | endif |
---|
| 694 | |
---|
| 695 | cd dimension |
---|
[714] | 696 | ./makdim $ntrac $dim |
---|
[524] | 697 | cat $libf/grid/dimensions.h |
---|
| 698 | |
---|
| 699 | cd $LMDGCM |
---|
| 700 | set libo=$libo/$nomlib |
---|
| 701 | if ( ! -d $libo ) then |
---|
| 702 | mkdir $libo |
---|
| 703 | cd $model |
---|
| 704 | endif |
---|
| 705 | |
---|
| 706 | ######################################################################## |
---|
| 707 | # Differentes dynamiques (3d, 2d, 1d) |
---|
| 708 | ######################################################################## |
---|
| 709 | |
---|
| 710 | set dimension=`echo $dim | wc -w` |
---|
| 711 | echo dimension $dimension |
---|
| 712 | if ( $dimension == 1 ) then |
---|
| 713 | echo pas de dynamique |
---|
| 714 | set dyn="L_DYN= DYN= L_FILTRE= DIRMAIN=phy$physique " |
---|
| 715 | endif |
---|
| 716 | endif |
---|
| 717 | cd $model |
---|
| 718 | if ( $dimension == 3 ) then |
---|
| 719 | cd libf/grid |
---|
| 720 | \rm fxyprim.h |
---|
| 721 | cp -p fxy_${grille}.h fxyprim.h |
---|
| 722 | endif |
---|
| 723 | |
---|
| 724 | ###################################################################### |
---|
| 725 | # Traitement special pour le nouveau rayonnement de Laurent Li. |
---|
| 726 | ###################################################################### |
---|
| 727 | |
---|
| 728 | if ( -f $libf/phy$physique/raddim.h ) then |
---|
| 729 | if ( -f $libf/phy$physique/raddim.$dimh.h ) then |
---|
| 730 | \rm -f $libf/phy$physique/raddim.h |
---|
| 731 | cp -p $libf/phy$physique/raddim.$dimh.h $libf/phy$physique/raddim.h |
---|
| 732 | echo $libf/phy$physique/raddim.$dimh.h |
---|
| 733 | cat $libf/phy$physique/raddim.$dimh.h |
---|
| 734 | cat $libf/phy$physique/raddim.h |
---|
| 735 | else |
---|
| 736 | echo On peut diminuer la taille de l executable en creant |
---|
| 737 | echo le fichier $libf/phy$physique/raddim.$dimh.h |
---|
| 738 | \cp -p $libf/phy$physique/raddim.defaut.h $libf/phy$physique/raddim.h |
---|
| 739 | endif |
---|
| 740 | endif |
---|
| 741 | |
---|
| 742 | ###################################################################### |
---|
| 743 | # Gestion du filtre qui n'existe qu'en 3d. |
---|
| 744 | ###################################################################### |
---|
| 745 | |
---|
| 746 | if ( `expr $dimc \> 2` == 1 ) then |
---|
| 747 | set filtre="FILTRE=$filtre" |
---|
| 748 | else |
---|
| 749 | set filtre="FILTRE= L_FILTRE= " |
---|
| 750 | endif |
---|
| 751 | echo MACRO FILTRE $filtre |
---|
| 752 | |
---|
| 753 | echo $dimc |
---|
| 754 | |
---|
| 755 | ######################################################################## |
---|
| 756 | # utilisation des vraies routines de couplage si on est en couple |
---|
| 757 | ######################################################################## |
---|
| 758 | if ( $couple == 'true' ) then |
---|
[714] | 759 | banner couple |
---|
[524] | 760 | pwd |
---|
[714] | 761 | if ( "$psmile" == 'true' ) then |
---|
| 762 | if ( -f $libf/phy$physique/oasis.F ) then |
---|
| 763 | \rm $libf/phy$physique/oasis.F |
---|
| 764 | endif |
---|
| 765 | if ( ! -f $libf/phy$physique/oasis.F90 ) then |
---|
| 766 | \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 |
---|
| 767 | endif |
---|
| 768 | if ( `diff $libf/phy$physique/oasis.F90 $libf/phy$physique/oasis.psmile | wc -w` ) then |
---|
| 769 | \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 |
---|
| 770 | endif |
---|
| 771 | else |
---|
| 772 | if ( -f $libf/phy$physique/oasis.F90 ) then |
---|
| 773 | \rm $libf/phy$physique/oasis.F90 |
---|
| 774 | endif |
---|
| 775 | if (! -f $libf/phy$physique/oasis.F ) then |
---|
| 776 | \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F |
---|
| 777 | else |
---|
| 778 | if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then |
---|
| 779 | # \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy |
---|
| 780 | \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F |
---|
| 781 | endif |
---|
| 782 | endif |
---|
| 783 | endif |
---|
[524] | 784 | else |
---|
[714] | 785 | if ( -f $libf/phy$physique/oasis.F90 ) then |
---|
| 786 | \rm $libf/phy$physique/oasis.F90 |
---|
[524] | 787 | endif |
---|
[714] | 788 | if (! -f $libf/phy$physique/oasis.F ) then |
---|
| 789 | \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F |
---|
| 790 | else |
---|
| 791 | if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then |
---|
| 792 | \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true |
---|
| 793 | \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F |
---|
| 794 | endif |
---|
| 795 | endif |
---|
[524] | 796 | endif |
---|
| 797 | ######################################################################## |
---|
| 798 | # Avant de lancer le make, on recree le makefile si necessaire |
---|
| 799 | ######################################################################## |
---|
[714] | 800 | ######################################################################## |
---|
[524] | 801 | # c'est a dire dans 3 cas: |
---|
| 802 | # 1. si la liste des fichiers .F et .h a ete modifiee depuis la |
---|
| 803 | # derniere creation du makefile |
---|
| 804 | # 2. si le fichier contenant cette liste "liste_des_sources" |
---|
| 805 | # n'existe pas. |
---|
| 806 | # 3. Si le makefile n'existe pas. |
---|
| 807 | ######################################################################## |
---|
[714] | 808 | ########################################## |
---|
| 809 | # On adapte d'abord certains include à F90 |
---|
| 810 | ########################################## |
---|
[722] | 811 | #sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp |
---|
| 812 | #if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then |
---|
| 813 | # \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h |
---|
| 814 | #endif |
---|
[714] | 815 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ s/) {if (NR > 1) print p0," &"; sub (" s"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/dyn3d/paramet.h >! $libf/dyn3d/paramet90.tmp |
---|
| 816 | # sed -n -e 's/^c/\!/' -e '1 h' -e '2,$ H' -e '$ { x ; s/\n s/ \&\n \& /g ; p }' $libf/dyn3d/paramet.h >! $libf/dyn3d/paramet90.tmp |
---|
| 817 | if ( ! -f $libf/dyn3d/paramet90.h || `diff $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h | wc -w` ) then |
---|
| 818 | \mv $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h |
---|
| 819 | endif |
---|
| 820 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ \./) {if (NR > 1) print p0," &"; sub (" \."," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/dyn3d/control.h >! $libf/dyn3d/control.tmp |
---|
| 821 | #sed -n -e 's/^c/\!/' -e '1 h' -e '2,$ H' -e '$ { x ; s/\n \./ \&\n \& /g ; p }' $libf/dyn3d/control.h >! $libf/dyn3d/control.tmp |
---|
| 822 | if ( ! -f $libf/dyn3d/control.inc || `diff $libf/dyn3d/control.tmp $libf/dyn3d/control.inc | wc -w` ) then |
---|
| 823 | \mv $libf/dyn3d/control.tmp $libf/dyn3d/control.inc |
---|
| 824 | endif |
---|
| 825 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ S/) {if (NR > 1) print p0," &"; sub (" S"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/phylmd/YOMCST.h >! $libf/phylmd/YOMCST.tmp |
---|
| 826 | if ( ! -f $libf/phylmd/YOMCST.inc || `diff $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc | wc -w` ) then |
---|
| 827 | \mv $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc |
---|
| 828 | endif |
---|
| 829 | awk 'BEGIN {} { sub ("^c","\!") ; if ($0 ~ /^ S/) {if (NR > 1) print p0," &"; sub (" S"," \\&")} else { if (NR > 1) print p0 } p0=$0 } END { print p0}' $libf/phylmd/clesphys.h >! $libf/phylmd/clesphys.tmp |
---|
| 830 | if ( ! -f $libf/phylmd/clesphys.inc || `diff $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc | wc -w` ) then |
---|
| 831 | \mv $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc |
---|
| 832 | endif |
---|
| 833 | #sed -e 's/^c/\!/' $libf/dyn3dpar/paramet.h >! $libf/dyn3dpar/paramet90.h |
---|
| 834 | ########################################## |
---|
[524] | 835 | cd $model |
---|
| 836 | find libf -name '*.[Fh]' -print >! tmp77 |
---|
| 837 | find libf -name '*.[Fh]' -exec egrep -i " *use *ioipsl" {} \; -print >! tmp90 |
---|
| 838 | find libf -name '*.[Fh]90' -print >> tmp90 |
---|
| 839 | |
---|
| 840 | if ( `diff tmp77 liste_des_sources_f77 | wc -w` \ |
---|
| 841 | || `diff tmp90 liste_des_sources_f90 | wc -w` \ |
---|
| 842 | || ! -f makefile \ |
---|
| 843 | || ! -f liste_des_sources_f90 \ |
---|
| 844 | || ! -f liste_des_sources_f77 ) then |
---|
| 845 | echo les fichiers suivants ont ete crees ou detruits |
---|
| 846 | echo ou les fichiers suivants sont passes ou ne sont plus en Fortran 90 |
---|
| 847 | diff liste_des_sources_f77 tmp77 |
---|
| 848 | diff liste_des_sources_f90 tmp90 |
---|
| 849 | \cp tmp77 liste_des_sources_f77 |
---|
| 850 | \cp tmp90 liste_des_sources_f90 |
---|
| 851 | echo On recree le makefile |
---|
| 852 | ./create_make_gcm >! tmp |
---|
| 853 | \mv tmp makefile |
---|
| 854 | echo Nouveau makefile cree. |
---|
| 855 | endif |
---|
| 856 | |
---|
| 857 | ######################################################################## |
---|
| 858 | # Execution de la comande make |
---|
| 859 | ######################################################################## |
---|
| 860 | |
---|
| 861 | echo PHYSIQUE $phys |
---|
| 862 | echo dynamique $dyn $dimension |
---|
| 863 | echo OPTIM="$optim" $filtre LIBO=$libo $dyn PHYS=$phys DIM=$dimc PROG=$code |
---|
| 864 | echo PATH pour les fichiers INCLUDE $include |
---|
| 865 | echo OPLINK="$oplink" |
---|
| 866 | |
---|
[714] | 867 | ################# |
---|
| 868 | if $HP then |
---|
| 869 | ################# |
---|
| 870 | set f77='fort77 +OP' |
---|
| 871 | set f90='jensaisrien' |
---|
| 872 | set opt_link="$opt_link -lm" |
---|
| 873 | ################# |
---|
| 874 | else if $VPP then |
---|
| 875 | ################# |
---|
| 876 | set f77=frt |
---|
| 877 | set f90=$f77 |
---|
| 878 | if ($couple == true) then |
---|
| 879 | set opt_link="-Wg,-c $MODIPSLDIR/liboasis2.4_mpi2.a /usr/lang/mpi2/lib64/libmpi.a /usr/lang/mpi2/lib64/libmp.a -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 880 | set oplink="-Wl,-t,-P,-dy " |
---|
| 881 | else |
---|
| 882 | set opt_link="-Wg,-c -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 883 | set oplink="-Wl,-t,-dy " |
---|
| 884 | endif |
---|
| 885 | if ($veget == true) then |
---|
| 886 | set opt_link="$opt_link $link_veget -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" |
---|
| 887 | endif |
---|
| 888 | ################# |
---|
| 889 | else if $CRAY then |
---|
| 890 | ################# |
---|
| 891 | set f77=f90 |
---|
| 892 | set f90=f90 |
---|
| 893 | ################# |
---|
| 894 | else if $LINUX then |
---|
| 895 | ################# |
---|
| 896 | # set f77=pgf90 |
---|
| 897 | # set f90=pgf90 |
---|
| 898 | set f77=$FC_LINUX |
---|
| 899 | set f90=$FC_LINUX |
---|
| 900 | if ( $FC_LINUX == 'pgf90' ) then |
---|
| 901 | set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf -Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2/" |
---|
| 902 | else if ($FC_LINUX == 'g95') then |
---|
| 903 | set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf " |
---|
| 904 | else |
---|
| 905 | set opt_link=" " |
---|
| 906 | endif |
---|
| 907 | ################# |
---|
| 908 | else if $SUN then |
---|
| 909 | ################# |
---|
| 910 | set f77=f90 |
---|
| 911 | set f90=f90 |
---|
| 912 | set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf " |
---|
| 913 | ################# |
---|
| 914 | else if $NEC then |
---|
| 915 | ################# |
---|
| 916 | set f77=f90 -ftrace |
---|
| 917 | set f90=f90 -ftrace |
---|
| 918 | set opt_link="-L$MODIPSLDIR" |
---|
| 919 | if ($veget == true) then |
---|
| 920 | set opt_link="$opt_link $link_veget" |
---|
| 921 | endif |
---|
| 922 | if ($couple == true) then |
---|
| 923 | set opt_link="$opt_link -lioipsl -loasis2.4_mpi2 -float0 -ew -P static $NCDFLIB " |
---|
| 924 | else |
---|
| 925 | set opt_link="$opt_link -L$MODIPSLDIR -lioipsl -float0 -ew -P static $NCDFLIB " |
---|
| 926 | endif |
---|
| 927 | set mod_loc_dir="./" |
---|
| 928 | ################# |
---|
| 929 | else if $XNEC then |
---|
| 930 | ################# |
---|
| 931 | set f77="sxmpif90 -ftrace" |
---|
| 932 | set f90="sxmpif90 -ftrace" |
---|
| 933 | if $MODIPSL then |
---|
| 934 | set opt_link="-L$MODIPSLDIR" |
---|
| 935 | if ($veget == true) then |
---|
| 936 | set opt_link="$opt_link $link_veget" |
---|
| 937 | endif |
---|
| 938 | if ($couple == true) then |
---|
| 939 | if ($psmile == true) then |
---|
| 940 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 941 | else |
---|
| 942 | set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " |
---|
| 943 | endif |
---|
| 944 | else |
---|
| 945 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 946 | endif |
---|
| 947 | else |
---|
| 948 | if ($couple == true) then |
---|
| 949 | set opt_link="-L$MODIPSLDIR" |
---|
| 950 | set opt_link="$opt_link $link_veget -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " |
---|
| 951 | else |
---|
| 952 | set opt_link=" -C hopt -float0 $optdbl -P static -L$MODIPSLDIR $link_veget -lsxioipsl $NCDFLIB " |
---|
| 953 | endif |
---|
| 954 | endif |
---|
| 955 | set mod_loc_dir="./" |
---|
| 956 | ################## |
---|
| 957 | else if $X6NEC then |
---|
| 958 | ################## |
---|
| 959 | set f77=sxmpif90 |
---|
| 960 | set f90=sxmpif90 |
---|
| 961 | if $MODIPSL then |
---|
| 962 | set opt_link="-L$MODIPSLDIR" |
---|
| 963 | if ($veget == true) then |
---|
| 964 | set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate" |
---|
| 965 | endif |
---|
| 966 | if ($couple == true) then |
---|
| 967 | if ($psmile == true) then |
---|
| 968 | set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 969 | else |
---|
| 970 | set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 971 | endif |
---|
| 972 | else |
---|
| 973 | set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " |
---|
| 974 | endif |
---|
| 975 | else |
---|
| 976 | # set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB " |
---|
| 977 | set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB " |
---|
[669] | 978 | |
---|
[714] | 979 | endif |
---|
| 980 | set mod_loc_dir="./" |
---|
[722] | 981 | ################## |
---|
| 982 | else if $X8BRODIE then |
---|
| 983 | ################## |
---|
| 984 | set f77=sxmpif90 |
---|
| 985 | set f90=sxmpif90 |
---|
| 986 | if $MODIPSL then |
---|
[732] | 987 | set opt_link="$opt_link -float0 -Wf,-A dbl4 -L$MODIPSLDIR -lblas" |
---|
[722] | 988 | if ($veget == true) then |
---|
| 989 | set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate" |
---|
| 990 | endif |
---|
| 991 | if ($couple == true) then |
---|
| 992 | if ($psmile == true) then |
---|
| 993 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 994 | else |
---|
| 995 | set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " |
---|
| 996 | endif |
---|
| 997 | else |
---|
| 998 | set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " |
---|
| 999 | endif |
---|
| 1000 | else |
---|
| 1001 | # set opt_link=" -float0 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB " |
---|
| 1002 | set opt_link=" -float0 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB " |
---|
| 1003 | |
---|
| 1004 | endif |
---|
| 1005 | set mod_loc_dir="./" |
---|
[714] | 1006 | ################# |
---|
| 1007 | else |
---|
| 1008 | ################# |
---|
| 1009 | set f77=f77 |
---|
| 1010 | set f90=f90 |
---|
| 1011 | endif |
---|
| 1012 | |
---|
| 1013 | cd $model |
---|
| 1014 | |
---|
| 1015 | if $VPP then |
---|
| 1016 | set make="gmake RANLIB=ls" |
---|
| 1017 | else if $CRAY then |
---|
| 1018 | set make="make RANLIB=ls" |
---|
| 1019 | else if $NEC then |
---|
| 1020 | set make="make RANLIB=ls" |
---|
| 1021 | else if $LINUX then |
---|
| 1022 | set make="make -k RANLIB=ranlib" |
---|
| 1023 | else if $XNEC then |
---|
| 1024 | set make="gmake RANLIB=ls" |
---|
| 1025 | else if $X6NEC then |
---|
| 1026 | set make="gmake RANLIB=ls" |
---|
[722] | 1027 | else if $X8BRODIE then |
---|
| 1028 | set make="gmake RANLIB=ls" |
---|
[714] | 1029 | else |
---|
| 1030 | set make="make RANLIB=ranlib" |
---|
| 1031 | endif |
---|
| 1032 | |
---|
| 1033 | |
---|
| 1034 | |
---|
| 1035 | |
---|
| 1036 | # |
---|
| 1037 | # etat0_netcdf a besoin d'info de la physique |
---|
| 1038 | # A revoir |
---|
[524] | 1039 | set include="$include"' -I$(LIBF)/phy'"$physique" |
---|
[714] | 1040 | # |
---|
| 1041 | # le programme principal create_limit a besoin de l'info du module |
---|
| 1042 | # startvar: on met donc libo dans les include pour Nec |
---|
[524] | 1043 | set include="$include"' -I$(LIBO)' |
---|
| 1044 | |
---|
| 1045 | |
---|
| 1046 | ################################################################# |
---|
| 1047 | # Execution de la comande make... ENFIN! |
---|
| 1048 | ################################################################# |
---|
| 1049 | |
---|
[714] | 1050 | if $VPP then |
---|
| 1051 | set optim90=" $optim90 -Am -M$libo" |
---|
| 1052 | set optimtru90="$optim90" |
---|
| 1053 | \cp $IOIPSLDIR/*.mod $libo |
---|
| 1054 | else if $SUN then |
---|
| 1055 | set optim90=" $optim90 -M$libo -M$MODIPSLDIR " |
---|
| 1056 | set optimtru90=" $optimtru90 -M$libo -M$MODIPSLDIR " |
---|
| 1057 | set optim="$optim90" |
---|
| 1058 | \cp $IOIPSLDIR/*.mod $libo |
---|
| 1059 | else if $NEC then |
---|
| 1060 | set optim90=" $optim90 -I$libo " |
---|
| 1061 | else if $XNEC then |
---|
| 1062 | set optim90=" $optim90 -I$libo " |
---|
| 1063 | set optimtru90=" $optimtru90 -I$libo " |
---|
| 1064 | else if $X6NEC then |
---|
| 1065 | set optim90=" $optim90 -I$libo " |
---|
| 1066 | set optimtru90=" $optimtru90 -I$libo " |
---|
[722] | 1067 | else if $X8BRODIE then |
---|
| 1068 | set optim90=" $optim90 -I$libo " |
---|
| 1069 | set optimtru90=" $optimtru90 -I$libo " |
---|
[714] | 1070 | else if $LINUX then |
---|
| 1071 | if ( $FC_LINUX == "pgf90" ) then |
---|
| 1072 | set optimtru90=" $optimtru90 -module $libo " |
---|
| 1073 | set optim90=" $optim90 -module $libo " |
---|
| 1074 | else if ( $FC_LINUX == 'g95' ) then |
---|
| 1075 | set optimtru90=" $optimtru90 -fmod=$libo " |
---|
| 1076 | set optim90=" $optim90 -fmod=$libo " |
---|
| 1077 | endif |
---|
| 1078 | set optim="$optim90" |
---|
| 1079 | set mod_loc_dir=$libo |
---|
| 1080 | # \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo |
---|
| 1081 | # \cp $IOIPSLDIR/*.mod $libo |
---|
| 1082 | endif |
---|
[524] | 1083 | |
---|
[714] | 1084 | set link="$f90 $optim90" |
---|
[524] | 1085 | |
---|
[714] | 1086 | set ar=ar |
---|
| 1087 | |
---|
| 1088 | if $XNEC then |
---|
| 1089 | set link="sxld $opt_link" |
---|
| 1090 | set link="$f90 " |
---|
| 1091 | # set ar=sxar |
---|
| 1092 | else if $X6NEC then |
---|
| 1093 | set link="sxld $opt_link" |
---|
| 1094 | set link="$f90 " |
---|
[722] | 1095 | else if $X8BRODIE then |
---|
| 1096 | set link="sxld $opt_link" |
---|
| 1097 | set link="$f90 " |
---|
[714] | 1098 | endif |
---|
| 1099 | |
---|
| 1100 | |
---|
[524] | 1101 | cd $localdir |
---|
| 1102 | |
---|
| 1103 | echo $make -f $LMDGCM/makefile \ |
---|
| 1104 | OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ |
---|
| 1105 | OPTIM90="$optim90" \ |
---|
| 1106 | OPTIMTRU90="$optimtru90" \ |
---|
| 1107 | OPTIM="$optim$optimbis" \ |
---|
| 1108 | INCLUDE="$include" \ |
---|
| 1109 | $filtre \ |
---|
| 1110 | LIBO=$libo \ |
---|
| 1111 | $dyn \ |
---|
| 1112 | $phys \ |
---|
| 1113 | DIM=$dimc \ |
---|
[725] | 1114 | FLAG_PARA="$FLAG_PARA"\ |
---|
[524] | 1115 | L_ADJNT="$adjnt" \ |
---|
[714] | 1116 | L_CHIMIE="$libchimie" \ |
---|
[524] | 1117 | LOCAL_DIR="$localdir" \ |
---|
| 1118 | F77="$f77" \ |
---|
| 1119 | F90="$f90" \ |
---|
| 1120 | OPLINK="$oplink" \ |
---|
| 1121 | LINK="$link" \ |
---|
| 1122 | GCM="$LMDGCM" \ |
---|
| 1123 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 1124 | MOD_SUFFIX=$mod_suffix \ |
---|
| 1125 | AR=$ar \ |
---|
| 1126 | PROG=$code |
---|
| 1127 | |
---|
| 1128 | $make -f $LMDGCM/makefile \ |
---|
| 1129 | OPTION_DEP="$opt_dep" OPTION_LINK="$opt_link" \ |
---|
| 1130 | OPTIM90="$optim90" \ |
---|
| 1131 | OPTIMTRU90="$optimtru90" \ |
---|
| 1132 | OPTIM="$optim$optimbis" \ |
---|
| 1133 | INCLUDE="$include" \ |
---|
| 1134 | $filtre \ |
---|
| 1135 | LIBO=$libo \ |
---|
| 1136 | $dyn \ |
---|
| 1137 | $phys \ |
---|
| 1138 | DIM=$dimc \ |
---|
[725] | 1139 | FLAG_PARA="$FLAG_PARA"\ |
---|
[524] | 1140 | L_ADJNT="$adjnt" \ |
---|
[714] | 1141 | L_CHIMIE="$libchimie" \ |
---|
[524] | 1142 | LOCAL_DIR="$localdir" \ |
---|
| 1143 | F77="$f77" \ |
---|
| 1144 | F90="$f90" \ |
---|
| 1145 | OPLINK="$oplink" \ |
---|
| 1146 | LINK="$link" \ |
---|
| 1147 | GCM="$LMDGCM" \ |
---|
| 1148 | MOD_LOC_DIR=$mod_loc_dir \ |
---|
| 1149 | MOD_SUFFIX=$mod_suffix \ |
---|
| 1150 | AR=$ar \ |
---|
| 1151 | PROG=$code |
---|
| 1152 | |
---|
| 1153 | \rm -f $libf/grid/dimensions.h |
---|