Changeset 768 for LMDZ4/trunk/makegcm


Ignore:
Timestamp:
Jun 4, 2007, 4:46:03 PM (17 years ago)
Author:
Laurent Fairhead
Message:

Merge entre la version V3_conv et le HEAD
YM, JG, LF

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ4/trunk/makegcm

    r680 r768  
    1010set physique=lmd
    1111set phys="PHYS=$physique"
    12 set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. '
     12set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I$(LIBF)/filtrez -I. '
    1313set ntrac = 4
    1414set filtre=filtrez
    1515set grille=reg
    1616set couple=false
    17 set veget=true
     17set veget=false
    1818set chimie=false
    1919set psmile=false
    2020set parallel=false
     21set vampir=false
    2122set OPT_STACK='-Wf,-init stack=nan'
    2223set OPT_STACK=' '
     
    2627set io=ioipsl
    2728
    28 set FC_LINUX=g95
     29set FC_LINUX=pgf90
    2930
    3031########################################################################
     
    3637#setenv LIBOGCM $LMDGCM/libo
    3738#set LMDGCM="`pwd`"
     39set INCALIB=../INCA3/lib
    3840#setenv LIBOGCM $LMDGCM/libo
    3941#
    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/"
     42#setenv IOIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib
     43#setenv MODIPSLDIR /u/fairhead/modipsl_ioipsl_3/lib
     44#setenv NCDFINC /distrib/local/netcdf/pgi_32bits/include
     45#setenv NCDFLIB /distrib/local/netcdf/pgi_32bits/lib/
     46
     47
    4448
    4549setenv localdir "`pwd`"
     
    6468      set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
    6569      set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
     70    else  if ( `hostname` == brodie ) then
     71      set NCDFINC=`grep sx8brodie ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
     72      set NCDFLIB=`grep sx8brodie ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
    6673    else
    6774      echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
     
    112119set XNEC=0
    113120set X6NEC=0
     121set X8BRODIE=0
    114122if ( `uname` == HP-UX ) then
    115123   set machine=HP
     
    127135   set machine=ALPHA
    128136   set DEC=1
    129 else if ( `uname` == Linux && `hostname` != mercure ) then
     137else if ( `uname` == Linux && `hostname` != mercure  && `hostname` != brodie ) then
    130138   set machine=LINUX
    131139   set LINUX=1
     
    142150   set machine=X6NEC
    143151   set X6NEC=1
     152else if ( `hostname` == brodie) then
     153   set machine=X8BRODIE
     154   set X8BRODIE=1
    144155else
    145156   echo Vous travaillez sur une machine non prevue par le reglement
     
    231242     set optim="-fast "
    232243     set optim90=" -fast "
    233 #   set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR "
    234244     set optimtru90=" -fast -c -Mfree "
     245#     set optim=" "
     246#     set optim90="  "
     247#     set optimtru90=" -c -Mfree "
    235248   else if ( $FC_LINUX == 'g95' ) then
    236249     set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic "
     
    267280#################
    268281   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"'
     282   set optim90=' -clear -float0 -size_t64 -P stack -Wf "-ptr byte -init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
     283   set optimtru90=' -clear -f4 -float0 -size_t64 -P stack -Wf "-ptr byte -init stack=nan -init heap=nan" -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"'
     284   set optim="$optim90"
     285   set optimbis=" "
     286   set mod_suffix="mod"
     287   set mod_loc_dir="./"
     288#################
     289else if $X8BRODIE then
     290##################
     291   set optdbl='-dw -Wf\"-A dbl4\"' 
     292#   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'
     293   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'
     294#   set optim90='-C vsafe -P stack -Wf,-pvctl res=whole,-A dbl4,-ptr byte -EP -R5 -float0 -dw -Wf,"-pvctl loopcnt=999999 fullmsg noassume" -I/SX/usr/include'
     295   set optimtru90="$optim90"
     296   set optim90="$optim90"
    271297   set optim="$optim90"
    272298   set optimbis=" "
     
    503529########################################################################
    504530
     531set cppflags=''
     532
     533if $X8BRODIE then
     534  set cppflags="$cppflags -DNC_DOUBLE -DBLAS -DSGEMV=DGEMV -DSGEMM=DGEMM"
     535endif
     536
    505537if ( $io == ioipsl ) then
    506    set optim="$optim -DCPP_IOIPSL"
    507    set optim90="$optim"
    508    set optimtru90="$optimtru90 -DCPP_IOIPSL"
     538   set cppflags="$cppflags -DCPP_IOIPSL"
    509539endif
    510540
     
    512542   set phys="L_PHY= LIBPHY="
    513543else
    514    set optim="$optim -DCPP_PHYS"
    515    set optim90="$optim"
    516    set optimtru90="$optimtru90 -DCPP_PHYS"
     544   set cppflags="$cppflags -DCPP_PHYS"
    517545endif
    518546
    519547set link_veget=" "
    520548if ( "$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"
     549   set cppflags="$cppflags -DCPP_VEGET"
     550   set link_veget=" -lsechiba -lparameters -lstomate -lparallel"
     551   if ( $XNEC || $X8BRODIE || $X6NEC) then
     552      set link_veget=" -lsxsechiba -lsxparameters -lsxstomate -lsxparallel"
    527553   endif
    528554endif
    529555
    530556if ( "$chimie" == 'CH4' ) then
    531     set optim="$optim -DINCA -DINCA_CH4 "
    532     set optim90="$optim"
     557    set cppflags="$cppflags -DINCA -DINCA_CH4 "
    533558else if ( "$chimie" == 'CH4_AER' ) then
    534     set optim="$optim -DINCA -DINCA_CH4 -DINCA_AER"
    535     set optim90="$optim"
     559    set cppflags="$cppflags -DINCA -DINCA_CH4 -DINCA_AER"
    536560else if ( "$chimie" == 'NMHC' ) then
    537     set optim="$optim -DINCA -DINCA_NMHC "
    538     set optim90="$optim"
     561    set cppflags="$cppflags -DINCA -DINCA_NMHC "
    539562else if ( "$chimie" == 'NMHC_AER' ) then
    540     set optim="$optim -DINCA -DINCA_NMHC -DINCA_AER"
    541     set optim90="$optim"
     563    set cppflags="$cppflags -DINCA -DINCA_NMHC -DINCA_AER"
    542564else if ( "$chimie" == 'AER' ) then
    543     set optim="$optim -DINCA -DINCA_AER"
    544     set optim90="$optim"
     565    set cppflags="$cppflags -DINCA -DINCA_AER"
    545566else if ("$chimie" == 'GES' ) then
    546     set optim="$optim -DINCA"
    547     set optim90="$optim"
     567    set cppflags="$cppflags -DINCA"
    548568endif
    549569if ( "$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
     570#    set opt_dep="$opt_dep chimie"
     571    set libchimie=" -L$INCALIB -lchimie"
     572    set opt_link="$opt_link  -L$INCALIB -lchimie"
     573#    set libchimie="-lchimie"
     574#    if ( $XNEC || $X6NEC || $X8BRODIE ) then
     575#      set libchimie="-lsxchimie"
     576#    endif
    555577endif
    556578   
    557579if ( "$couple" == 'true' ) then
    558    set optim="$optim -DCPP_COUPLE"
    559    set optim90="$optim90 -DCPP_COUPLE"
    560    set optimtru90="$optimtru90 -DCPP_COUPLE"
     580   set cppflags="$cppflags -DCPP_COUPLE"
    561581endif
    562582
    563583if ( "$psmile" == 'true' ) then
    564    set optim="$optim -DCPP_PSMILE"
    565    set optim90="$optim90 -DCPP_PSMILE"
    566    set optimtru90="$optimtru90 -DCPP_PSMILE"
    567 endif
    568 
     584   set cppflags="$cppflags -DCPP_PSMILE"
     585endif
     586
     587set FLAG_PARA=''
    569588if ( "$parallel" == 'true' ) then
    570    set optim="$optim -DCPP_PARALLEL"
    571    set optim90="$optim90 -DCPP_PARALLEL"
    572    set optimtru90="$optimtru90 -DCPP_PARALLEL"
    573 endif
     589   set cppflags="$cppflags -DCPP_PARA"
     590   set FLAG_PARA='par'
     591endif
     592
     593set optim="$optim $cppflags"
     594set optim90="$optim90 $cppflags"
     595set optimtru90="$optimtru90 $cppflags"
     596
    574597
    575598########################################################################
     
    633656    set nomlib=F90_${dim_}_t${ntrac}
    634657endif
    635 if ( $NEC || $XNEC || $X6NEC) then
     658if ( $NEC || $XNEC || $X6NEC || $X8BRODIE ) then
    636659    set nomlib=F90_${dim_}_t${ntrac}
    637660endif
     
    643666set dimh=$dim
    644667else
    645 set include="$include "'-I$(LIBF)/dyn3d '
     668set include="$include "'-I$(LIBF)/dyn3d${FLAG_PARA} '
    646669set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
    647670endif
     
    794817# On adapte d'abord certains include à F90
    795818##########################################
    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
     819#sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp
     820#if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then
     821#      \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h
     822#endif
    800823awk '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
    801824# 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
     
    884907   set f90=$FC_LINUX
    885908   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/"
     909   set opt_link=" -L$MODIPSLDIR $link_veget -L$NCDFLIB -lioipsl -lnetcdf -Wl,-Bstatic -L/usr/lib/gcc-lib/i386-linux/2.95.2/"
    887910   else if ($FC_LINUX == 'g95') then
    888911     set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf "
     
    945968   set f90=sxmpif90
    946969   if $MODIPSL then
    947      set opt_link="-L$MODIPSLDIR"
     970     set opt_link="$opt_link -L$MODIPSLDIR"
    948971     if ($veget == true) then
    949        set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate"
     972       set opt_link="$opt_link $link_veget"
    950973     endif
    951974     if ($couple == true) then
     
    960983   else
    961984#     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 "
     985     set opt_link=" $opt_link -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB "
     986
     987   endif
     988   set mod_loc_dir="./"
     989##################
     990else if $X8BRODIE then
     991##################
     992   set f77=sxmpif90
     993   set f90=sxmpif90
     994   if $MODIPSL then
     995     set opt_link="$opt_link -float0 -Wf,-A dbl4 -L$MODIPSLDIR -lblas"
     996     if ($veget == true) then
     997       set opt_link="$opt_link $link_veget"
     998     endif
     999     if ($couple == true) then
     1000        if ($psmile == true) then
     1001        set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB "
     1002        else
     1003        set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB "
     1004        endif
     1005     else
     1006       set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB "
     1007     endif
     1008   else
     1009#     set opt_link=" -float0 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB "
     1010     set opt_link=" -float0 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB "
    9631011
    9641012   endif
     
    9841032set make="gmake RANLIB=ls"
    9851033else if $X6NEC then
     1034set make="gmake RANLIB=ls"
     1035else if $X8BRODIE then
    9861036set make="gmake RANLIB=ls"
    9871037else
     
    10231073 set optim90=" $optim90 -I$libo "
    10241074 set optimtru90=" $optimtru90 -I$libo "
     1075else if $X8BRODIE then
     1076 set optim90=" $optim90 -I$libo "
     1077 set optimtru90=" $optimtru90 -I$libo "
    10251078else if $LINUX then
    10261079 if ( $FC_LINUX == "pgf90" ) then
     
    10331086 set optim="$optim90"
    10341087 set mod_loc_dir=$libo
    1035  \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo
    1036  \cp $IOIPSLDIR/*.mod $libo
     1088# \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo
     1089# \cp $IOIPSLDIR/*.mod $libo
    10371090endif
    10381091
     
    10471100else if $X6NEC then
    10481101  set link="sxld $opt_link"
    1049   set link="$f90 "
     1102  set link="$f90 -Wl,-hlib_cyclic "
     1103else if $X8BRODIE then
     1104  set link="sxld $opt_link"
     1105  set link="$f90 -Wl,-hlib_cyclic "
    10501106endif
    10511107
     
    10641120$phys \
    10651121DIM=$dimc \
     1122FLAG_PARA="$FLAG_PARA"\
    10661123L_ADJNT="$adjnt" \
    10671124L_CHIMIE="$libchimie" \
     
    10881145$phys \
    10891146DIM=$dimc \
     1147FLAG_PARA="$FLAG_PARA"\
    10901148L_ADJNT="$adjnt" \
    10911149L_CHIMIE="$libchimie" \
Note: See TracChangeset for help on using the changeset viewer.