- Timestamp:
- Sep 27, 2006, 12:31:36 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ4/branches/V3_test/makegcm
r704 r714 4 4 # 5 5 #set verbose echo 6 ######################################################################## 7 # options par defaut pour la commande make 8 ######################################################################## 9 set dim="48x32x19" 10 set physique=lmd 11 set phys="PHYS=$physique" 12 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. ' 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 28 29 set FC_LINUX=pgf90 6 30 7 31 ######################################################################## … … 10 34 11 35 ###### VERSION LMDZ.4 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 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/ 19 45 20 46 setenv localdir "`pwd`" 21 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/^.* =//'` 67 else 68 echo 'Probleme de definition des variables NCDFINC et NCDFLIB' 69 endif 70 endif 71 else 22 72 if ( ! $?LMDGCM ) then 23 73 echo You must initialize the variable LMDGCM in your environnement … … 25 75 exit 26 76 endif 27 28 77 if ( ! $?LIBOGCM ) then 29 78 set LIBOGCM=$LMDGCM/libo 30 79 endif 31 32 80 if ( ! $?IOIPSLDIR ) then 33 81 echo You must initialize the variable IOIPSLDIR in your environnement 34 82 echo for instance: "setenv IOIPSLDIR /usr/myself/ioipsl" in .cshrc 35 83 exit 84 else 85 setenv MODIPSLDIR $IOIPSLDIR 36 86 endif 37 38 87 if ( ! $?NCDFLIB ) then 39 88 echo You must initialize the variable NCDFLIB in your environnement … … 41 90 exit 42 91 endif 43 44 92 if ( ! $?NCDFINC ) then 45 93 echo You must initialize the variable NCDFINC in your environnement … … 48 96 endif 49 97 endif 50 51 98 set model=$LMDGCM 52 set libf=$model/libf53 99 set libo=$LIBOGCM 100 101 ######################################################################## 102 # Les differentes platformes reconnues 103 ######################################################################## 104 105 set HP=0 106 set IBM=0 107 set SUN=0 108 set VPP=0 109 set CRAY=0 110 set DEC=0 111 set LINUX=0 112 set NEC=0 113 set XNEC=0 114 set X6NEC=0 115 if ( `uname` == HP-UX ) then 116 set machine=HP 117 set HP=1 118 else if (`uname` == UNIX_System_V ) then 119 set machine=VPP 120 set VPP=1 121 else if (`uname` == SunOS ) then 122 set machine=SUN 123 set SUN=1 124 else if ( `uname` == AIX ) then 125 set machine=IBM 126 set IBM=1 127 else if ( `uname` == OSF1 ) then 128 set machine=ALPHA 129 set DEC=1 130 else if ( `uname` == Linux && `hostname` != mercure ) then 131 set machine=LINUX 132 set LINUX=1 133 else if ( `hostname` == atlas || `hostname` == axis || `hostname` == etoile ) then 134 set machine=CRAY 135 set CRAY=1 136 else if ( `uname` == SUPER-UX ) then 137 set machine=NEC 138 set NEC=1 139 else if ( `hostname` == rhodes) then 140 set machine=XNEC 141 set XNEC=1 142 else if ( `hostname` == mercure) then 143 set machine=X6NEC 144 set X6NEC=1 145 else 146 echo Vous travaillez sur une machine non prevue par le reglement 147 exit 148 endif 149 54 150 if ( ! -d $libo ) then 55 151 mkdir $libo 56 152 endif 57 153 154 155 if $VPP then 156 set netcdf=netcdf_v 157 else 158 set netcdf=netcdf 159 endif 58 160 ######################################################################## 59 161 # Quelques initialisations de variables du shell. … … 64 166 set adjnt="" 65 167 set opt_dep="" 168 set libchimie="" 66 169 67 170 set optim="" … … 70 173 set oplink="" 71 174 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 175 ######################################################################## 176 # Optimisations par defaut suivant les machines 177 ######################################################################## 178 179 echo "Optimisations par defaut suivant les machines" 180 set libf=$model/libf 181 #setenv localdir "LOCAL_DIR=`pwd`" 182 #setenv localdir "`pwd`" 183 cd $model 184 ############# 185 if $CRAY then 186 ############# 187 # set optim="-Wf'-ei' -dp -Wf'-a static'" 188 set optimbis=" -DCRAY " 189 set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv ' 190 set optim="$optim90" 191 set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl -L$NCDFLIB -lnetcdf " 192 set mod_loc_dir=" " 193 set mod_suffix=" " 194 ################# 195 else if $SUN then 196 ################# 197 set optim=" -fast " 198 set optimbis=" " 199 set optim90=" -fast -fixed " 200 set optimtru90=" -fast -free " 201 set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf " 202 set mod_loc_dir=$localdir 203 set mod_suffix=mod 204 ################# 205 else if $HP then 206 ################# 207 set optim=" +U77 -O +E1 " 208 set optimbis=" " 209 ################# 210 else if $IBM then 211 ################# 212 set optim=" -O3 -qtune=pwr2 -qarch=pwr2" 213 set optimbis=" " 214 ################# 215 else if $VPP then 216 ################# 217 # set optim="-Dasuxm -On, -g -Ad -Potilax -Eciplume -Si" 218 # set optimbis=" -Wv,-m3 -Wp,-DVPP -Z $LMDGCM/listage" 219 set optimbis=" -Wp,-DNC_DOUBLE -Ad -Z $LMDGCM/listage -X9" 220 set optim90="$optim $optimbis -X9 -w" 221 set mod_loc_dir=$MODIPSLDIR 222 set mod_suffix=mod 223 ################# 224 else if $DEC then 225 ################# 226 set optim=" " 227 set optimbis=" " 228 ################# 229 else if $LINUX then 230 ################# 231 if ( $FC_LINUX == "pgf90" ) then 232 set optim="-fast " 233 set optim90=" -fast " 234 # set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR " 235 set optimtru90=" -fast -c -Mfree " 236 else if ( $FC_LINUX == 'g95' ) then 237 set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " 238 set optim90=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic " 239 set optimtru90=" $OPT_LINUX -fno-second-underscore -ffree-form -fstatic " 240 else 241 echo 'compilateur linux non reconnu' 242 exit 243 endif 244 set mod_loc_dir=$MODIPSLDIR 245 set mod_suffix=mod 246 ################# 247 else if $NEC then 248 ################# 249 set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' 250 set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "' 251 set optim="$optim90" 252 set optimbis=" " 253 set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl $NCDFLIB -lnetcdf_i8r8_v " 254 set mod_loc_dir="." 255 set mod_suffix="mod" 256 ################# 257 else if $XNEC then 258 ################# 259 set optdbl='-dw -Wf\"-A dbl4\"' 260 set optim90=' -clear -float0 -f3 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "' 261 set optimtru90=' -clear -f4 -float0 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"' 262 set optim="$optim90" 263 set optimbis=" " 264 set mod_suffix="mod" 265 set mod_loc_dir="./" 266 ################# 267 else if $X6NEC then 268 ################# 269 set optdbl='-dw -Wf\"-A dbl4\"' 270 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 "' 271 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"' 272 set optim="$optim90" 273 set optimbis=" " 274 set mod_suffix="mod" 275 set mod_loc_dir="./" 276 else 277 set optim="" 278 set optimbis=" " 279 endif 280 281 set nomlib=$machine 152 282 153 283 ######################################################################## … … 231 361 pour selectionner le mode psmile ou non (par defaut) 232 362 363 -parallel false|true 364 pour selectionner le mode parallele ou non (false par defaut) 365 233 366 -v true|false 234 367 pour selectionner la vegetation (par defaut) ou non 368 369 -chimie CH4|CH4_AER|NMHC|NMHC_AER|AER|GES|false 370 pour selectionner ou non la chimie (par defaut sans) 235 371 236 372 -g grille selectionne le type de grille qu'on veut utiliser. … … 298 434 299 435 case -psmile 300 set psmile="$2" ; shift ; shift ; goto top 436 set psmile="$2" 437 if ( "$psmile" == 'true' ) then 438 set couple='true' 439 endif 440 shift ; shift ; goto top 441 442 case -chimie 443 set chimie="$2" ; shift ; shift ; goto top 444 445 case -parallel 446 set parallel="$2" ; shift ; shift ; goto top 301 447 302 448 case -t … … 317 463 318 464 case -debug 319 if $X6NEC then 465 if $HP then 466 set optim=" -g " 467 else if $SUN then 468 setenv PARALLEL 2 469 # Il faut rajouter l'option -dalign a -g pour pouvoir editer les liens 470 # avec des programmes compiles avec -fast 471 set optim=" -g -dalign " 472 set optim90=" -fixed -g " 473 set optimtru90=" -free -g -C -dalign " 474 else if $CRAY then 475 set optim="$optim"" -g " 476 set optim90="$optim90"" -G1 " 477 else if $LINUX then 478 if ( $FC_LINUX == "pgf90" ) then 479 set optim="$optim"" -g -C -Mbounds " 480 set optim90="$optim90"" -g -C -Mbounds " 481 set optimtru90="$optimtru90"" -g -C -Mbounds " 482 else if ( $FC_LINUX == 'g95' ) then 483 set optim="$optim"" -g -fbounds-check " 484 set optim90="$optim90"" -g -fbounds-check " 485 set optimtru90="$optimtru90"" -g -fbounds-check " 486 else 487 echo 'compilateur linux non reconnu' 488 exit 489 endif 320 490 else 321 491 echo pas d option debug predefinie pour cette machine … … 334 504 ######################################################################## 335 505 506 set cppflags='' 507 336 508 if ( $io == ioipsl ) then 337 set optim="$optim -DCPP_IOIPSL" 338 set optim90="$optim90 -DCPP_IOIPSL" 339 set optimtru90="$optimtru90 -DCPP_IOIPSL" 509 set cppflags="$cppflags -DCPP_IOIPSL" 340 510 endif 341 511 … … 343 513 set phys="L_PHY= LIBPHY=" 344 514 else 345 set optim="$optim -DCPP_PHYS" 346 set optim90="$optim90 -DCPP_PHYS" 347 set optimtru90="$optimtru90 -DCPP_PHYS" 348 endif 349 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='' 362 endif 515 set cppflags="$cppflags -DCPP_PHYS" 516 endif 517 518 set link_veget=" " 519 if ( "$veget" == 'true' ) then 520 set cppflags="$cppflags -DCPP_VEGET" 521 set link_veget=" -lsechiba -lparameters -lstomate" 522 if ( $XNEC ) then 523 set link_veget=" -lsxsechiba -lsxparameters -lsxstomate" 524 endif 525 endif 526 527 if ( "$chimie" == 'CH4' ) then 528 set cppflags="$cppflags -DINCA -DINCA_CH4 " 529 else if ( "$chimie" == 'CH4_AER' ) then 530 set cppflags="$cppflags -DINCA -DINCA_CH4 -DINCA_AER" 531 else if ( "$chimie" == 'NMHC' ) then 532 set cppflags="$cppflags -DINCA -DINCA_NMHC " 533 else if ( "$chimie" == 'NMHC_AER' ) then 534 set cppflags="$cppflags -DINCA -DINCA_NMHC -DINCA_AER" 535 else if ( "$chimie" == 'AER' ) then 536 set cppflags="$cppflags -DINCA -DINCA_AER" 537 else if ("$chimie" == 'GES' ) then 538 set cppflags="$cppflags -DINCA" 539 endif 540 if ( "$chimie" == 'CH4' || "$chimie" == 'CH4_AER' || "$chimie" == 'NMHC' || "$chimie" == 'NMHC_AER' || "$chimie" == 'AER' || "$chimie" == 'GES' ) then 541 set opt_dep="$opt_dep chimie" 542 set libchimie="-lchimie" 543 if ( $XNEC || $X6NEC ) then 544 set libchimie="-lsxchimie" 545 endif 546 endif 547 548 if ( "$couple" == 'true' ) then 549 set cppflags="$cppflags -DCPP_COUPLE" 550 endif 551 552 if ( "$psmile" == 'true' ) then 553 set cppflags="$cppflags -DCPP_PSMILE" 554 endif 555 556 set FLAG_PARA='' 557 if ( "$parallel" == 'true' ) then 558 set cppflags="$cppflags -DCPP_PARALLEL" 559 set FLAG_PARA='_par' 560 endif 561 562 set optim="$optim $cppflags" 563 set optim90="$optim90 $cppflags" 564 set optimtru90="$optimtru90 $cppflags" 565 363 566 364 567 ######################################################################## … … 401 604 set suf=$suf$i 402 605 end 403 606 if ( ! $IBM ) then 607 set nomlib="$nomlib$suf" 608 endif 609 if ( $DEC ) then 610 set nomlib=DEC 611 endif 612 if ( $IBM ) then 613 set dim=`echo $dim | sed -en 's/[^0-9]/ /g'` 614 set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'` 615 else if ( $SUN ) then 616 set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 617 set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'` 618 else 404 619 set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'` 405 620 set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'` 406 set nomlib=`echo ${machine}_${dim_}_t${ntrac}` 407 621 endif 622 set nomlib=${nomlib}${physique}_${dim_}_t${ntrac}_$grille 623 ## M-A-F nomlib trop long sur CRAY pour ar 624 if ( $CRAY ) then 625 set nomlib=F90_${dim_}_t${ntrac} 626 endif 627 if ( $NEC || $XNEC || $X6NEC) then 628 set nomlib=F90_${dim_}_t${ntrac} 629 endif 408 630 echo calcul de la dimension 409 631 set dimc=`echo $dim | wc -w` … … 413 635 set dimh=$dim 414 636 else 415 set include="$include " 637 set include="$include "'-I$(LIBF)/dyn3d ' 416 638 set dimh=`echo $dim | awk ' { print $1 "." $2 } '` 417 639 endif … … 422 644 ######################################################################## 423 645 646 if ( $XNEC ) then 424 647 set include="$include -I$NCDFINC -I$IOIPSLDIR" 425 echo $include 648 else 649 set include="$include -I$NCDFINC -I$IOIPSLDIR" 650 endif 651 echo $include 426 652 427 653 ######################################################################## … … 445 671 446 672 cd dimension 447 makdim $ntrac $dim673 ./makdim $ntrac $dim 448 674 cat $libf/grid/dimensions.h 449 675 … … 508 734 ######################################################################## 509 735 if ( $couple == 'true' ) then 736 banner couple 510 737 pwd 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 519 else 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 738 if ( "$psmile" == 'true' ) then 739 if ( -f $libf/phy$physique/oasis.F ) then 740 \rm $libf/phy$physique/oasis.F 741 endif 742 if ( ! -f $libf/phy$physique/oasis.F90 ) then 743 \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 744 endif 745 if ( `diff $libf/phy$physique/oasis.F90 $libf/phy$physique/oasis.psmile | wc -w` ) then 746 \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90 747 endif 748 else 749 if ( -f $libf/phy$physique/oasis.F90 ) then 750 \rm $libf/phy$physique/oasis.F90 751 endif 752 if (! -f $libf/phy$physique/oasis.F ) then 753 \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F 754 else 755 if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then 756 # \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy 757 \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F 758 endif 759 endif 523 760 endif 524 rm -f $libf/phy$physique/oasis.F90 761 else 762 if ( -f $libf/phy$physique/oasis.F90 ) then 763 \rm $libf/phy$physique/oasis.F90 764 endif 765 if (! -f $libf/phy$physique/oasis.F ) then 766 \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F 767 else 768 if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then 769 \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true 770 \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F 771 endif 772 endif 525 773 endif 526 774 ######################################################################## 527 775 # Avant de lancer le make, on recree le makefile si necessaire 776 ######################################################################## 528 777 ######################################################################## 529 778 # c'est a dire dans 3 cas: … … 534 783 # 3. Si le makefile n'existe pas. 535 784 ######################################################################## 536 785 ########################################## 786 # On adapte d'abord certains include à F90 787 ########################################## 788 sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp 789 if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then 790 \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h 791 endif 792 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 793 # 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 794 if ( ! -f $libf/dyn3d/paramet90.h || `diff $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h | wc -w` ) then 795 \mv $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h 796 endif 797 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 798 #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 799 if ( ! -f $libf/dyn3d/control.inc || `diff $libf/dyn3d/control.tmp $libf/dyn3d/control.inc | wc -w` ) then 800 \mv $libf/dyn3d/control.tmp $libf/dyn3d/control.inc 801 endif 802 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 803 if ( ! -f $libf/phylmd/YOMCST.inc || `diff $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc | wc -w` ) then 804 \mv $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc 805 endif 806 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 807 if ( ! -f $libf/phylmd/clesphys.inc || `diff $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc | wc -w` ) then 808 \mv $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc 809 endif 810 #sed -e 's/^c/\!/' $libf/dyn3dpar/paramet.h >! $libf/dyn3dpar/paramet90.h 811 ########################################## 537 812 cd $model 538 813 find libf -name '*.[Fh]' -print >! tmp77 … … 567 842 echo OPLINK="$oplink" 568 843 569 844 ################# 845 if $HP then 846 ################# 847 set f77='fort77 +OP' 848 set f90='jensaisrien' 849 set opt_link="$opt_link -lm" 850 ################# 851 else if $VPP then 852 ################# 853 set f77=frt 854 set f90=$f77 855 if ($couple == true) then 856 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" 857 set oplink="-Wl,-t,-P,-dy " 858 else 859 set opt_link="-Wg,-c -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" 860 set oplink="-Wl,-t,-dy " 861 endif 862 if ($veget == true) then 863 set opt_link="$opt_link $link_veget -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a" 864 endif 865 ################# 866 else if $CRAY then 867 ################# 868 set f77=f90 869 set f90=f90 870 ################# 871 else if $LINUX then 872 ################# 873 # set f77=pgf90 874 # set f90=pgf90 875 set f77=$FC_LINUX 876 set f90=$FC_LINUX 877 if ( $FC_LINUX == 'pgf90' ) then 878 set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf -Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2/" 879 else if ($FC_LINUX == 'g95') then 880 set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf " 881 else 882 set opt_link=" " 883 endif 884 ################# 885 else if $SUN then 886 ################# 887 set f77=f90 888 set f90=f90 889 set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf " 890 ################# 891 else if $NEC then 892 ################# 893 set f77=f90 -ftrace 894 set f90=f90 -ftrace 895 set opt_link="-L$MODIPSLDIR" 896 if ($veget == true) then 897 set opt_link="$opt_link $link_veget" 898 endif 899 if ($couple == true) then 900 set opt_link="$opt_link -lioipsl -loasis2.4_mpi2 -float0 -ew -P static $NCDFLIB " 901 else 902 set opt_link="$opt_link -L$MODIPSLDIR -lioipsl -float0 -ew -P static $NCDFLIB " 903 endif 904 set mod_loc_dir="./" 905 ################# 906 else if $XNEC then 907 ################# 908 set f77="sxmpif90 -ftrace" 909 set f90="sxmpif90 -ftrace" 910 if $MODIPSL then 911 set opt_link="-L$MODIPSLDIR" 912 if ($veget == true) then 913 set opt_link="$opt_link $link_veget" 914 endif 915 if ($couple == true) then 916 if ($psmile == true) then 917 set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " 918 else 919 set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " 920 endif 921 else 922 set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB " 923 endif 924 else 925 if ($couple == true) then 926 set opt_link="-L$MODIPSLDIR" 927 set opt_link="$opt_link $link_veget -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB " 928 else 929 set opt_link=" -C hopt -float0 $optdbl -P static -L$MODIPSLDIR $link_veget -lsxioipsl $NCDFLIB " 930 endif 931 endif 932 set mod_loc_dir="./" 933 ################## 934 else if $X6NEC then 935 ################## 936 set f77=sxmpif90 937 set f90=sxmpif90 938 if $MODIPSL then 939 set opt_link="-L$MODIPSLDIR" 940 if ($veget == true) then 941 set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate" 942 endif 943 if ($couple == true) then 944 if ($psmile == true) then 945 set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " 946 else 947 set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB " 948 endif 949 else 950 set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB " 951 endif 952 else 953 # set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB " 954 set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB " 955 956 endif 957 set mod_loc_dir="./" 958 ################# 959 else 960 ################# 961 set f77=f77 962 set f90=f90 963 endif 964 965 cd $model 966 967 if $VPP then 968 set make="gmake RANLIB=ls" 969 else if $CRAY then 970 set make="make RANLIB=ls" 971 else if $NEC then 972 set make="make RANLIB=ls" 973 else if $LINUX then 974 set make="make -k RANLIB=ranlib" 975 else if $XNEC then 976 set make="gmake RANLIB=ls" 977 else if $X6NEC then 978 set make="gmake RANLIB=ls" 979 else 980 set make="make RANLIB=ranlib" 981 endif 982 983 984 985 986 # 987 # etat0_netcdf a besoin d'info de la physique 988 # A revoir 570 989 set include="$include"' -I$(LIBF)/phy'"$physique" 990 # 991 # le programme principal create_limit a besoin de l'info du module 992 # startvar: on met donc libo dans les include pour Nec 571 993 set include="$include"' -I$(LIBO)' 572 994 … … 576 998 ################################################################# 577 999 1000 if $VPP then 1001 set optim90=" $optim90 -Am -M$libo" 1002 set optimtru90="$optim90" 1003 \cp $IOIPSLDIR/*.mod $libo 1004 else if $SUN then 1005 set optim90=" $optim90 -M$libo -M$MODIPSLDIR " 1006 set optimtru90=" $optimtru90 -M$libo -M$MODIPSLDIR " 1007 set optim="$optim90" 1008 \cp $IOIPSLDIR/*.mod $libo 1009 else if $NEC then 1010 set optim90=" $optim90 -I$libo " 1011 else if $XNEC then 1012 set optim90=" $optim90 -I$libo " 1013 set optimtru90=" $optimtru90 -I$libo " 1014 else if $X6NEC then 1015 set optim90=" $optim90 -I$libo " 1016 set optimtru90=" $optimtru90 -I$libo " 1017 else if $LINUX then 1018 if ( $FC_LINUX == "pgf90" ) then 1019 set optimtru90=" $optimtru90 -module $libo " 1020 set optim90=" $optim90 -module $libo " 1021 else if ( $FC_LINUX == 'g95' ) then 1022 set optimtru90=" $optimtru90 -fmod=$libo " 1023 set optim90=" $optim90 -fmod=$libo " 1024 endif 1025 set optim="$optim90" 1026 set mod_loc_dir=$libo 1027 # \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo 1028 # \cp $IOIPSLDIR/*.mod $libo 1029 endif 1030 1031 set link="$f90 $optim90" 1032 1033 set ar=ar 1034 1035 if $XNEC then 1036 set link="sxld $opt_link" 1037 set link="$f90 " 1038 # set ar=sxar 1039 else if $X6NEC then 1040 set link="sxld $opt_link" 1041 set link="$f90 " 1042 endif 578 1043 579 1044 … … 591 1056 $phys \ 592 1057 DIM=$dimc \ 593 FLAG_PARA="$FLAG_PARA"\594 1058 L_ADJNT="$adjnt" \ 1059 L_CHIMIE="$libchimie" \ 595 1060 LOCAL_DIR="$localdir" \ 596 1061 F77="$f77" \ … … 603 1068 AR=$ar \ 604 1069 PROG=$code 605 606 1070 607 1071 $make -f $LMDGCM/makefile \ … … 616 1080 $phys \ 617 1081 DIM=$dimc \ 618 FLAG_PARA="$FLAG_PARA"\619 1082 L_ADJNT="$adjnt" \ 1083 L_CHIMIE="$libchimie" \ 620 1084 LOCAL_DIR="$localdir" \ 621 1085 F77="$f77" \
Note: See TracChangeset
for help on using the changeset viewer.