Changeset 704 for LMDZ4/branches/V3_test/makegcm
- Timestamp:
- Aug 17, 2006, 5:41:51 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/V3_test/makegcm
r680 r704 4 4 # 5 5 #set verbose echo 6 ########################################################################7 # options par defaut pour la commande make8 ########################################################################9 set dim="96x71x19"10 set physique=lmd11 set phys="PHYS=$physique"12 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. '13 set ntrac = 414 set filtre=filtrez15 set grille=reg16 set couple=false17 set veget=true18 set chimie=false19 set psmile=false20 set parallel=false21 set OPT_STACK='-Wf,-init stack=nan'22 set OPT_STACK=' '23 set OPTIMI='-C debug -eC '24 set OPTIMI=' -ftrace '25 set OPT_LINUX='-O3'26 set io=ioipsl27 28 set FC_LINUX=g9529 6 30 7 ######################################################################## … … 33 10 34 11 ###### VERSION LMDZ.4 35 #set LMDGCM=/workdir/p86cozic/INCA_dev/LMDZ4 36 #setenv LIBOGCM $LMDGCM/libo 37 #set LMDGCM="`pwd`" 38 #setenv LIBOGCM $LMDGCM/libo 39 # 40 #setenv IOIPSLDIR /u/fairhead/modipsl_g95/lib 41 #setenv MODIPSLDIR /u/fairhead/modipsl_g95/lib 42 #setenv NCDFINC "/u/fairhead/netcdf-3.6.0-p1/linux-g95/include/" 43 #setenv NCDFLIB "/u/fairhead/netcdf-3.6.0-p1/linux-g95/lib/" 12 13 set LMDGCM=$WORKDIR/LMDZ4_V3_LAURENT 14 set NCDFLIB=/usr/local/SX6/soft/netcdf/lib 15 set NCDFINC=/usr/local/SX6/soft/netcdf/include 16 set IOIPSLDIR=$WORKDIR/IOIPSL_MPP/src 17 set ORCH_LIBDIR=$WORKDIR/LSCE/ORCHIDEE_PARA/libbis 18 #1set IOIPSLDIR=$SCRATCHDIR/MODIPSL_NEW/modipsl/lib 44 19 45 20 setenv localdir "`pwd`" 46 set MODIPSL=0 47 echo $localdir | grep modipsl >& /dev/null 48 if ( ! $status ) then 49 set MODIPSL=1 50 setenv LMDGCM $localdir 51 cd ../.. 52 setenv LIBOGCM "`pwd`/lib" 53 setenv IOIPSLDIR $LIBOGCM 54 setenv MODIPSLDIR $LIBOGCM 55 cd $localdir 56 if ( `hostname` == rhodes ) then 57 set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` 58 set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` 59 else 60 if ( `hostname` == nymphea0 ) then 61 set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` 62 set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` 63 else if ( `hostname` == mercure ) then 64 set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"` 65 set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'` 66 else 67 echo 'Probleme de definition des variables NCDFINC et NCDFLIB' 68 endif 69 endif 70 else 21 71 22 if ( ! $?LMDGCM ) then 72 23 echo You must initialize the variable LMDGCM in your environnement … … 74 25 exit 75 26 endif 27 76 28 if ( ! $?LIBOGCM ) then 77 29 set LIBOGCM=$LMDGCM/libo 78 30 endif 31 79 32 if ( ! $?IOIPSLDIR ) then 80 33 echo You must initialize the variable IOIPSLDIR in your environnement 81 34 echo for instance: "setenv IOIPSLDIR /usr/myself/ioipsl" in .cshrc 82 35 exit 83 else 84 setenv MODIPSLDIR $IOIPSLDIR 85 endif 36 endif 37 86 38 if ( ! $?NCDFLIB ) then 87 39 echo You must initialize the variable NCDFLIB in your environnement … … 89 41 exit 90 42 endif 43 91 44 if ( ! $?NCDFINC ) then 92 45 echo You must initialize the variable NCDFINC in your environnement … … 95 48 endif 96 49 endif 50 97 51 set model=$LMDGCM 52 set libf=$model/libf 98 53 set libo=$LIBOGCM 99 100 ########################################################################101 # Les differentes platformes reconnues102 ########################################################################103 104 set HP=0105 set IBM=0106 set SUN=0107 set VPP=0108 set CRAY=0109 set DEC=0110 set LINUX=0111 set NEC=0112 set XNEC=0113 set X6NEC=0114 if ( `uname` == HP-UX ) then115 set machine=HP116 set HP=1117 else if (`uname` == UNIX_System_V ) then118 set machine=VPP119 set VPP=1120 else if (`uname` == SunOS ) then121 set machine=SUN122 set SUN=1123 else if ( `uname` == AIX ) then124 set machine=IBM125 set IBM=1126 else if ( `uname` == OSF1 ) then127 set machine=ALPHA128 set DEC=1129 else if ( `uname` == Linux && `hostname` != mercure ) then130 set machine=LINUX131 set LINUX=1132 else if ( `hostname` == atlas || `hostname` == axis || `hostname` == etoile ) then133 set machine=CRAY134 set CRAY=1135 else if ( `uname` == SUPER-UX ) then136 set machine=NEC137 set NEC=1138 else if ( `hostname` == rhodes) then139 set machine=XNEC140 set XNEC=1141 else if ( `hostname` == mercure) then142 set machine=X6NEC143 set X6NEC=1144 else145 echo Vous travaillez sur une machine non prevue par le reglement146 exit147 endif148 149 54 if ( ! -d $libo ) then 150 55 mkdir $libo 151 56 endif 152 57 153 154 if $VPP then155 set netcdf=netcdf_v156 else157 set netcdf=netcdf158 endif159 58 ######################################################################## 160 59 # Quelques initialisations de variables du shell. … … 165 64 set adjnt="" 166 65 set opt_dep="" 167 set libchimie=""168 66 169 67 set optim="" … … 172 70 set oplink="" 173 71 174 ######################################################################## 175 # Optimisations par defaut suivant les machines 176 ######################################################################## 177 178 echo "Optimisations par defaut suivant les machines" 179 set libf=$model/libf 180 #setenv localdir "LOCAL_DIR=`pwd`" 181 #setenv localdir "`pwd`" 182 cd $model 183 ############# 184 if $CRAY then 185 ############# 186 # set optim="-Wf'-ei' -dp -Wf'-a static'" 187 set optimbis=" -DCRAY " 188 set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv ' 189 set optim="$optim90" 190 set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl -L$NCDFLIB -lnetcdf " 191 set mod_loc_dir=" " 192 set mod_suffix=" " 193 ################# 194 else if $SUN then 195 ################# 196 set optim=" -fast " 197 set optimbis=" " 198 set optim90=" -fast -fixed " 199 set optimtru90=" -fast -free " 200 set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf " 201 set mod_loc_dir=$localdir 202 set mod_suffix=mod 203 ################# 204 else if $HP then 205 ################# 206 set optim=" +U77 -O +E1 " 207 set optimbis=" " 208 ################# 209 else if $IBM then 210 ################# 211 set optim=" -O3 -qtune=pwr2 -qarch=pwr2" 212 set optimbis=" " 213 ################# 214 else if $VPP then 215 ################# 216 # set optim="-Dasuxm -On, -g -Ad -Potilax -Eciplume -Si" 217 # set optimbis=" -Wv,-m3 -Wp,-DVPP -Z $LMDGCM/listage" 218 set optimbis=" -Wp,-DNC_DOUBLE -Ad -Z $LMDGCM/listage -X9" 219 set optim90="$optim $optimbis -X9 -w" 220 set mod_loc_dir=$MODIPSLDIR 221 set mod_suffix=mod 222 ################# 223 else if $DEC then 224 ################# 225 set optim=" " 226 set optimbis=" " 227 ################# 228 else if $LINUX then 229 ################# 230 if ( $FC_LINUX == "pgf90" ) then 231 set optim="-fast " 232 set optim90=" -fast " 233 # set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR " 234 set optimtru90=" -fast -c -Mfree " 235 else if ( $FC_LINUX == 'g95' ) then 236 set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " 237 set optim90=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " 238 set optimtru90=" $OPT_LINUX -fno-second-underscore -ffree-form -fstatic " 239 else 240 echo 'compilateur linux non reconnu' 241 exit 242 endif 243 set mod_loc_dir=$MODIPSLDIR 244 set mod_suffix=mod 245 ################# 246 else if $NEC then 247 ################# 248 set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' 249 set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' 250 set optim="$optim90" 251 set optimbis=" " 252 set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl $NCDFLIB -lnetcdf_i8r8_v " 253 set mod_loc_dir="." 254 set mod_suffix="mod" 255 ################# 256 else if $XNEC then 257 ################# 258 set optdbl='-dw -Wf\"-A dbl4\"' 259 set optim90=' -clear -float0 -f3 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' 260 set optimtru90=' -clear -f4 -float0 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' 261 set optim="$optim90" 262 set optimbis=" " 263 set mod_suffix="mod" 264 set mod_loc_dir="./" 265 ################# 266 else if $X6NEC then 267 ################# 268 set optdbl='-dw -Wf\"-A dbl4\"' 269 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 "' 270 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"' 271 set optim="$optim90" 272 set optimbis=" " 273 set mod_suffix="mod" 274 set mod_loc_dir="./" 275 else 276 set optim="" 277 set optimbis=" " 278 endif 279 280 set nomlib=$machine 72 73 ######################################################################## 74 # options du compilateur 75 ######################################################################## 76 77 set machine=SX6 78 set f77=sxf90.new 79 set f90=sxf90.new 80 set optim90='-C vsafe -gv -P stack -Wf,-pvctl res=whole,-A dbl4,-init stack=nan,-init heap=nan,-ptr byte -EP -ts ${GCM}/tmp_src -R5 -float0 -size_t64 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume" -I/SX/usr/include' 81 set optimtru90="$optim90" 82 set optim="$optim90" 83 set cppflags='-DNC_DOUBLE -DBLAS -DSGEMV=DGEMV -DSGEMM=DGEMM' 84 set opt_link='-float0 -size_t64 -Wf,-A dbl4 -lblas' 85 set mod_suffix="mod" 86 set mod_loc_dir="./" 87 set make="sxmake -i RANLIB=ls" 88 set link="$f90 -Wl,-hlib_cyclic" 89 set ar=sxar 90 set optim90="$optim90 -f3" 91 92 ######################################################################## 93 # options par defaut pour la commande make 94 ######################################################################## 95 96 set dim="96x72x19" 97 set physique=lmd 98 set phys="PHYS=$physique" 99 set include='-I$(LIBF)/filtrez -I$(LIBF)/grid -I$(LIBF)/bibio -I. ' 100 set ntrac = 4 101 set filtre=filtrez 102 set grille=reg 103 set couple=false 104 set veget=false 105 set psmile=false 106 set io=ioipsl 107 set inca=false 108 set vampir=false 109 set parallel=false 110 111 if ($parallel == true) then 112 set cppflags = " $cppflags -DCPP_PARA" 113 set include="$include"' -I$(LIBF)/dyn3d_par' 114 else 115 set include="$include"' -I$(LIBF)/dyn3d' 116 endif 117 118 if ($inca == true) then 119 set cppflags="$cppflags -DINCA -DINCA_CH4" 120 set opt_link="$opt_link -linca" 121 endif 122 123 if ($couple == true) then 124 set opt_link="$opt_link -L/scratchdir/p86yann/MODIPSL_NEW/modipsl/prism/SX/lib -lpsmile.MPI2 -lmpp_io" 125 set cppflags="$cppflags -DCPP_COUPLE -DCPP_PSMILE -I/scratchdir/p86yann/MODIPSL_NEW/modipsl/prism/SX/build/lib/psmile.MPI2" 126 endif 127 128 if ($veget == true) then 129 set opt_link="$opt_link -L $ORCH_LIBDIR -lsxparameters -lsxsechiba -lsxstomate -lsxparallel" 130 set cppflags="$cppflags -DCPP_VEGET" 131 set include="$include"" -I$ORCH_LIBDIR" 132 endif 133 134 if ($vampir == true) then 135 set cppflags="$cppflags -vt -DUSE_VT" 136 set opt_link="$opt_link -vt" 137 else 138 set cppflags="$cppflags -DNUSE_VT" 139 set opt_link="$opt_link" 140 endif 141 142 set optim90=" $optim90 -I$libo $cppflags" 143 set optimtru90=" $optimtru90 -I$libo $cppflags" 144 set optim=" $optim -I$libo $cppflags" 145 set opt_link="$opt_link -L$IOIPSLDIR -lsxioipsl -L$NCDFLIB -lnetcdf" 146 147 ######################################################################## 148 # Les differentes platformes reconnues 149 ######################################################################## 150 set X6NEC=1 151 281 152 282 153 ######################################################################## … … 360 231 pour selectionner le mode psmile ou non (par defaut) 361 232 362 -parallel false|true363 pour selectionner le mode parallele ou non (false par defaut)364 365 233 -v true|false 366 234 pour selectionner la vegetation (par defaut) ou non 367 368 -chimie CH4|CH4_AER|NMHC|NMHC_AER|AER|GES|false369 pour selectionner ou non la chimie (par defaut sans)370 235 371 236 -g grille selectionne le type de grille qu'on veut utiliser. … … 433 298 434 299 case -psmile 435 set psmile="$2" 436 if ( "$psmile" == 'true' ) then 437 set couple='true' 438 endif 439 shift ; shift ; goto top 440 441 case -chimie 442 set chimie="$2" ; shift ; shift ; goto top 443 444 case -parallel 445 set parallel="$2" ; shift ; shift ; goto top 300 set psmile="$2" ; shift ; shift ; goto top 446 301 447 302 case -t … … 462 317 463 318 case -debug 464 if $HP then 465 set optim=" -g " 466 else if $SUN then 467 setenv PARALLEL 2 468 # Il faut rajouter l'option -dalign a -g pour pouvoir editer les liens 469 # avec des programmes compiles avec -fast 470 set optim=" -g -dalign " 471 set optim90=" -fixed -g " 472 set optimtru90=" -free -g -C -dalign " 473 else if $CRAY then 474 set optim="$optim"" -g " 475 set optim90="$optim90"" -G1 " 476 else if $LINUX then 477 if ( $FC_LINUX == "pgf90" ) then 478 set optim="$optim"" -g -C -Mbounds " 479 set optim90="$optim90"" -g -C -Mbounds " 480 set optimtru90="$optimtru90"" -g -C -Mbounds " 481 else if ( $FC_LINUX == 'g95' ) then 482 set optim="$optim"" -g -fbounds-check " 483 set optim90="$optim90"" -g -fbounds-check " 484 set optimtru90="$optimtru90"" -g -fbounds-check " 485 else 486 echo 'compilateur linux non reconnu' 487 exit 488 endif 319 if $X6NEC then 489 320 else 490 321 echo pas d option debug predefinie pour cette machine … … 505 336 if ( $io == ioipsl ) then 506 337 set optim="$optim -DCPP_IOIPSL" 507 set optim90="$optim "338 set optim90="$optim90 -DCPP_IOIPSL" 508 339 set optimtru90="$optimtru90 -DCPP_IOIPSL" 509 340 endif … … 513 344 else 514 345 set optim="$optim -DCPP_PHYS" 515 set optim90="$optim "346 set optim90="$optim90 -DCPP_PHYS" 516 347 set optimtru90="$optimtru90 -DCPP_PHYS" 517 348 endif 518 349 519 set link_veget=" " 520 if ( "$veget" == 'true' ) then 521 set optim="$optim -DCPP_VEGET" 522 set optim90="$optim" 523 set optimtru90="$optimtru90 -DCPP_VEGET" 524 set link_veget=" -lsechiba -lparameters -lstomate" 525 if ( $XNEC ) then 526 set link_veget=" -lsxsechiba -lsxparameters -lsxstomate" 527 endif 528 endif 529 530 if ( "$chimie" == 'CH4' ) then 531 set optim="$optim -DINCA -DINCA_CH4 " 532 set optim90="$optim" 533 else if ( "$chimie" == 'CH4_AER' ) then 534 set optim="$optim -DINCA -DINCA_CH4 -DINCA_AER" 535 set optim90="$optim" 536 else if ( "$chimie" == 'NMHC' ) then 537 set optim="$optim -DINCA -DINCA_NMHC " 538 set optim90="$optim" 539 else if ( "$chimie" == 'NMHC_AER' ) then 540 set optim="$optim -DINCA -DINCA_NMHC -DINCA_AER" 541 set optim90="$optim" 542 else if ( "$chimie" == 'AER' ) then 543 set optim="$optim -DINCA -DINCA_AER" 544 set optim90="$optim" 545 else if ("$chimie" == 'GES' ) then 546 set optim="$optim -DINCA" 547 set optim90="$optim" 548 endif 549 if ( "$chimie" == 'CH4' || "$chimie" == 'CH4_AER' || "$chimie" == 'NMHC' || "$chimie" == 'NMHC_AER' || "$chimie" == 'AER' || "$chimie" == 'GES' ) then 550 set opt_dep="$opt_dep chimie" 551 set libchimie="-lchimie" 552 if ( $XNEC || $X6NEC ) then 553 set libchimie="-lsxchimie" 554 endif 555 endif 556 557 if ( "$couple" == 'true' ) then 558 set optim="$optim -DCPP_COUPLE" 559 set optim90="$optim90 -DCPP_COUPLE" 560 set optimtru90="$optimtru90 -DCPP_COUPLE" 561 endif 562 563 if ( "$psmile" == 'true' ) then 564 set optim="$optim -DCPP_PSMILE" 565 set optim90="$optim90 -DCPP_PSMILE" 566 set optimtru90="$optimtru90 -DCPP_PSMILE" 567 endif 568 569 if ( "$parallel" == 'true' ) then 570 set optim="$optim -DCPP_PARALLEL" 571 set optim90="$optim90 -DCPP_PARALLEL" 572 set optimtru90="$optimtru90 -DCPP_PARALLEL" 350 #set link_veget=" " 351 #if ( "$veget" == 'true' ) then 352 # set optim="$optim -DCPP_VEGET" 353 # set optim90="$optim90 -DCPP_VEGET" 354 # set optimtru90="$optimtru90 -DCPP_VEGET" 355 # set link_veget=" -lsechiba -lparameters -lstomate" 356 #endif 357 358 if ($parallel == 'true') then 359 set FLAG_PARA='_par' 360 else 361 set FLAG_PARA='' 573 362 endif 574 363 … … 612 401 set suf=$suf$i 613 402 end 614 if ( ! $IBM ) then 615 set nomlib="$nomlib$suf" 616 endif 617 if ( $DEC ) then 618 set nomlib=DEC 619 endif 620 if ( $IBM ) then 621 set dim=`echo $dim | sed -en 's/[^0-9]/ /g'` 622 set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'` 623 else if ( $SUN ) then 624 set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 625 set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` 626 else 403 627 404 set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'` 628 405 set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'` 629 endif 630 set nomlib=${nomlib}${physique}_${dim_}_t${ntrac}_$grille 631 ## M-A-F nomlib trop long sur CRAY pour ar 632 if ( $CRAY ) then 633 set nomlib=F90_${dim_}_t${ntrac} 634 endif 635 if ( $NEC || $XNEC || $X6NEC) then 636 set nomlib=F90_${dim_}_t${ntrac} 637 endif 406 set nomlib=`echo ${machine}_${dim_}_t${ntrac}` 407 638 408 echo calcul de la dimension 639 409 set dimc=`echo $dim | wc -w` … … 643 413 set dimh=$dim 644 414 else 645 set include="$include " '-I$(LIBF)/dyn3d '415 set include="$include " 646 416 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 647 417 endif … … 652 422 ######################################################################## 653 423 654 if ( $XNEC ) then655 424 set include="$include -I$NCDFINC -I$IOIPSLDIR" 656 else 657 set include="$include -I$NCDFINC -I$IOIPSLDIR" 658 endif 659 echo $include 425 echo $include 660 426 661 427 ######################################################################## … … 679 445 680 446 cd dimension 681 ./makdim $ntrac $dim447 makdim $ntrac $dim 682 448 cat $libf/grid/dimensions.h 683 449 … … 742 508 ######################################################################## 743 509 if ( $couple == 'true' ) then 744 banner couple745 510 pwd 746 if ( "$psmile" == 'true' ) then 747 if ( -f $libf/phy$physique/oasis.F ) then 748 \rm $libf/phy$physique/oasis.F 749 endif 750 if ( ! -f $libf/phy$physique/oasis.F90 ) then 751 \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 752 endif 753 if ( `diff $libf/phy$physique/oasis.F90 $libf/phy$physique/oasis.psmile | wc -w` ) then 754 \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 755 endif 756 else 757 if ( -f $libf/phy$physique/oasis.F90 ) then 758 \rm $libf/phy$physique/oasis.F90 759 endif 760 if (! -f $libf/phy$physique/oasis.F ) then 761 \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F 762 else 763 if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then 764 # \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy 765 \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F 766 endif 767 endif 768 endif 511 # if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then 512 # \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy 513 # \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F 514 # endif 515 if ( -f $libf/phy$physique/oasis.F ) then 516 rm -f $libf/phy$physique/oasis.F 517 endif 518 \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 769 519 else 770 if ( -f $libf/phy$physique/oasis.F90 ) then 771 \rm $libf/phy$physique/oasis.F90 772 endif 773 if (! -f $libf/phy$physique/oasis.F ) then 774 \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F 775 else 776 if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then 777 \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true 778 \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F 779 endif 780 endif 520 if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then 521 \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true 522 \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F 523 endif 524 rm -f $libf/phy$physique/oasis.F90 781 525 endif 782 526 ######################################################################## 783 527 # Avant de lancer le make, on recree le makefile si necessaire 784 ########################################################################785 528 ######################################################################## 786 529 # c'est a dire dans 3 cas: … … 791 534 # 3. Si le makefile n'existe pas. 792 535 ######################################################################## 793 ########################################## 794 # On adapte d'abord certains include à F90 795 ########################################## 796 sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp 797 if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then 798 \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h 799 endif 800 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 801 # 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 802 if ( ! -f $libf/dyn3d/paramet90.h || `diff $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h | wc -w` ) then 803 \mv $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h 804 endif 805 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 806 #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 807 if ( ! -f $libf/dyn3d/control.inc || `diff $libf/dyn3d/control.tmp $libf/dyn3d/control.inc | wc -w` ) then 808 \mv $libf/dyn3d/control.tmp $libf/dyn3d/control.inc 809 endif 810 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 811 if ( ! -f $libf/phylmd/YOMCST.inc || `diff $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc | wc -w` ) then 812 \mv $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc 813 endif 814 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 815 if ( ! -f $libf/phylmd/clesphys.inc || `diff $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc | wc -w` ) then 816 \mv $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc 817 endif 818 #sed -e 's/^c/\!/' $libf/dyn3dpar/paramet.h >! $libf/dyn3dpar/paramet90.h 819 ########################################## 536 820 537 cd $model 821 538 find libf -name '*.[Fh]' -print >! tmp77 … … 850 567 echo OPLINK="$oplink" 851 568 852 ################# 853 if $HP then 854 ################# 855 set f77='fort77 +OP' 856 set f90='jensaisrien' 857 set opt_link="$opt_link -lm" 858 ################# 859 else if $VPP then 860 ################# 861 set f77=frt 862 set f90=$f77 863 if ($couple == true) then 864 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" 865 set oplink="-Wl,-t,-P,-dy " 866 else 867 set opt_link="-Wg,-c -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" 868 set oplink="-Wl,-t,-dy " 869 endif 870 if ($veget == true) then 871 set opt_link="$opt_link $link_veget -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" 872 endif 873 ################# 874 else if $CRAY then 875 ################# 876 set f77=f90 877 set f90=f90 878 ################# 879 else if $LINUX then 880 ################# 881 # set f77=pgf90 882 # set f90=pgf90 883 set f77=$FC_LINUX 884 set f90=$FC_LINUX 885 if ( $FC_LINUX == 'pgf90' ) then 886 set opt_link=" -L /usr/local/pgi/linux86/lib -lpgf90 -lpgftnrtl -lpghpf -lpghpf2 -L$MODIPSLDIR $link_veget -L$NCDFLIB -lnetcdf -lioipsl -Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2/" 887 else if ($FC_LINUX == 'g95') then 888 set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf " 889 else 890 set opt_link=" " 891 endif 892 ################# 893 else if $SUN then 894 ################# 895 set f77=f90 896 set f90=f90 897 set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf " 898 ################# 899 else if $NEC then 900 ################# 901 set f77=f90 -ftrace 902 set f90=f90 -ftrace 903 set opt_link="-L$MODIPSLDIR" 904 if ($veget == true) then 905 set opt_link="$opt_link $link_veget" 906 endif 907 if ($couple == true) then 908 set opt_link="$opt_link -lioipsl -loasis2.4_mpi2 -float0 -ew -P static $NCDFLIB " 909 else 910 set opt_link="$opt_link -L$MODIPSLDIR -lioipsl -float0 -ew -P static $NCDFLIB " 911 endif 912 set mod_loc_dir="./" 913 ################# 914 else if $XNEC then 915 ################# 916 set f77="sxmpif90 -ftrace" 917 set f90="sxmpif90 -ftrace" 918 if $MODIPSL then 919 set opt_link="-L$MODIPSLDIR" 920 if ($veget == true) then 921 set opt_link="$opt_link $link_veget" 922 endif 923 if ($couple == true) then 924 if ($psmile == true) then 925 set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " 926 else 927 set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " 928 endif 929 else 930 set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " 931 endif 932 else 933 if ($couple == true) then 934 set opt_link="-L$MODIPSLDIR" 935 set opt_link="$opt_link $link_veget -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " 936 else 937 set opt_link=" -C hopt -float0 $optdbl -P static -L$MODIPSLDIR $link_veget -lsxioipsl $NCDFLIB " 938 endif 939 endif 940 set mod_loc_dir="./" 941 ################## 942 else if $X6NEC then 943 ################## 944 set f77=sxmpif90 945 set f90=sxmpif90 946 if $MODIPSL then 947 set opt_link="-L$MODIPSLDIR" 948 if ($veget == true) then 949 set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate" 950 endif 951 if ($couple == true) then 952 if ($psmile == true) then 953 set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " 954 else 955 set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB " 956 endif 957 else 958 set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " 959 endif 960 else 961 # set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB " 962 set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB " 963 964 endif 965 set mod_loc_dir="./" 966 ################# 967 else 968 ################# 969 set f77=f77 970 set f90=f90 971 endif 972 973 cd $model 974 975 if $VPP then 976 set make="gmake RANLIB=ls" 977 else if $CRAY then 978 set make="make RANLIB=ls" 979 else if $NEC then 980 set make="make RANLIB=ls" 981 else if $LINUX then 982 set make="make -k RANLIB=ranlib" 983 else if $XNEC then 984 set make="gmake RANLIB=ls" 985 else if $X6NEC then 986 set make="gmake RANLIB=ls" 987 else 988 set make="make RANLIB=ranlib" 989 endif 990 991 992 993 994 # 995 # etat0_netcdf a besoin d'info de la physique 996 # A revoir 569 997 570 set include="$include"' -I$(LIBF)/phy'"$physique" 998 #999 # le programme principal create_limit a besoin de l'info du module1000 # startvar: on met donc libo dans les include pour Nec1001 571 set include="$include"' -I$(LIBO)' 1002 572 … … 1006 576 ################################################################# 1007 577 1008 if $VPP then1009 set optim90=" $optim90 -Am -M$libo"1010 set optimtru90="$optim90"1011 \cp $IOIPSLDIR/*.mod $libo1012 else if $SUN then1013 set optim90=" $optim90 -M$libo -M$MODIPSLDIR "1014 set optimtru90=" $optimtru90 -M$libo -M$MODIPSLDIR "1015 set optim="$optim90"1016 \cp $IOIPSLDIR/*.mod $libo1017 else if $NEC then1018 set optim90=" $optim90 -I$libo "1019 else if $XNEC then1020 set optim90=" $optim90 -I$libo "1021 set optimtru90=" $optimtru90 -I$libo "1022 else if $X6NEC then1023 set optim90=" $optim90 -I$libo "1024 set optimtru90=" $optimtru90 -I$libo "1025 else if $LINUX then1026 if ( $FC_LINUX == "pgf90" ) then1027 set optimtru90=" $optimtru90 -module $libo "1028 set optim90=" $optim90 -module $libo "1029 else if ( $FC_LINUX == 'g95' ) then1030 set optimtru90=" $optimtru90 -fmod=$libo "1031 set optim90=" $optim90 -fmod=$libo "1032 endif1033 set optim="$optim90"1034 set mod_loc_dir=$libo1035 \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo1036 \cp $IOIPSLDIR/*.mod $libo1037 endif1038 1039 set link="$f90 $optim90"1040 1041 set ar=ar1042 1043 if $XNEC then1044 set link="sxld $opt_link"1045 set link="$f90 "1046 # set ar=sxar1047 else if $X6NEC then1048 set link="sxld $opt_link"1049 set link="$f90 "1050 endif1051 578 1052 579 … … 1064 591 $phys \ 1065 592 DIM=$dimc \ 593 FLAG_PARA="$FLAG_PARA"\ 1066 594 L_ADJNT="$adjnt" \ 1067 L_CHIMIE="$libchimie" \1068 595 LOCAL_DIR="$localdir" \ 1069 596 F77="$f77" \ … … 1076 603 AR=$ar \ 1077 604 PROG=$code 605 1078 606 1079 607 $make -f $LMDGCM/makefile \ … … 1088 616 $phys \ 1089 617 DIM=$dimc \ 618 FLAG_PARA="$FLAG_PARA"\ 1090 619 L_ADJNT="$adjnt" \ 1091 L_CHIMIE="$libchimie" \1092 620 LOCAL_DIR="$localdir" \ 1093 621 F77="$f77" \
Note: See TracChangeset
for help on using the changeset viewer.