Index: LMDZ4/branches/V3_test/makegcm
===================================================================
--- LMDZ4/branches/V3_test/makegcm	(revision 703)
+++ LMDZ4/branches/V3_test/makegcm	(revision 704)
@@ -4,27 +4,4 @@
 #
 #set verbose echo
-########################################################################
-# options par defaut pour la commande make
-########################################################################
-set dim="96x71x19"
-set physique=lmd
-set phys="PHYS=$physique"
-set include='-I$(LIBF)/grid -I$(LIBF)/bibio -I. '
-set ntrac = 4
-set filtre=filtrez
-set grille=reg
-set couple=false
-set veget=true
-set chimie=false
-set psmile=false
-set parallel=false
-set OPT_STACK='-Wf,-init stack=nan'
-set OPT_STACK=' '
-set OPTIMI='-C debug -eC '
-set OPTIMI=' -ftrace '
-set OPT_LINUX='-O3'
-set io=ioipsl
-
-set FC_LINUX=g95
 
 ########################################################################
@@ -33,40 +10,14 @@
 
 ###### VERSION LMDZ.4
-#set LMDGCM=/workdir/p86cozic/INCA_dev/LMDZ4
-#setenv LIBOGCM $LMDGCM/libo
-#set LMDGCM="`pwd`"
-#setenv LIBOGCM $LMDGCM/libo
-#
-#setenv IOIPSLDIR /u/fairhead/modipsl_g95/lib
-#setenv MODIPSLDIR /u/fairhead/modipsl_g95/lib
-#setenv NCDFINC "/u/fairhead/netcdf-3.6.0-p1/linux-g95/include/"
-#setenv NCDFLIB "/u/fairhead/netcdf-3.6.0-p1/linux-g95/lib/"
+
+set LMDGCM=$WORKDIR/LMDZ4_V3_LAURENT
+set NCDFLIB=/usr/local/SX6/soft/netcdf/lib
+set NCDFINC=/usr/local/SX6/soft/netcdf/include
+set IOIPSLDIR=$WORKDIR/IOIPSL_MPP/src
+set ORCH_LIBDIR=$WORKDIR/LSCE/ORCHIDEE_PARA/libbis
+#1set IOIPSLDIR=$SCRATCHDIR/MODIPSL_NEW/modipsl/lib
 
 setenv localdir "`pwd`"
-set MODIPSL=0
-echo $localdir | grep modipsl >& /dev/null
-if ( ! $status ) then
-  set MODIPSL=1
-  setenv LMDGCM $localdir
-  cd ../..
-  setenv LIBOGCM "`pwd`/lib"
-  setenv IOIPSLDIR $LIBOGCM
-  setenv MODIPSLDIR $LIBOGCM
-  cd $localdir
-  if ( `hostname` == rhodes ) then
-    set NCDFINC=`grep sxnec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
-    set NCDFLIB=`grep sxnec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
-  else
-    if ( `hostname` == nymphea0 ) then
-      set NCDFINC=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
-      set NCDFLIB=`grep fjvpp ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
-    else if ( `hostname` == mercure ) then
-      set NCDFINC=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_INC|sed -e "s/^.* =//"`
-      set NCDFLIB=`grep sx6nec ../../util/AA_make.gdef| grep NCDF_LIB|sed -e 's/^.* =//'`
-    else
-      echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
-    endif 
-  endif 
-else
+
   if ( ! $?LMDGCM ) then
     echo You must initialize the variable LMDGCM in your environnement
@@ -74,14 +25,15 @@
     exit
   endif
+
   if ( ! $?LIBOGCM ) then
     set LIBOGCM=$LMDGCM/libo
   endif
+
   if ( ! $?IOIPSLDIR ) then
     echo You must initialize the variable IOIPSLDIR in your environnement
     echo for instance: "setenv IOIPSLDIR /usr/myself/ioipsl" in .cshrc
     exit
-  else
-      setenv MODIPSLDIR $IOIPSLDIR
-  endif
+  endif
+
   if ( ! $?NCDFLIB ) then
     echo You must initialize the variable NCDFLIB in your environnement
@@ -89,4 +41,5 @@
     exit
   endif
+
   if ( ! $?NCDFINC ) then
     echo You must initialize the variable NCDFINC in your environnement
@@ -95,66 +48,12 @@
   endif
 endif
+
 set model=$LMDGCM
+set libf=$model/libf
 set libo=$LIBOGCM
-
-########################################################################
-#  Les differentes platformes reconnues
-########################################################################
-
-set HP=0
-set IBM=0
-set SUN=0
-set VPP=0
-set CRAY=0
-set DEC=0
-set LINUX=0
-set NEC=0
-set XNEC=0
-set X6NEC=0
-if ( `uname` == HP-UX ) then
-   set machine=HP
-   set HP=1
-else if (`uname` == UNIX_System_V ) then
-   set machine=VPP
-   set VPP=1
-else if (`uname` == SunOS ) then
-   set machine=SUN
-   set SUN=1
-else if ( `uname` == AIX ) then
-   set machine=IBM
-   set IBM=1
-else if ( `uname` == OSF1 ) then
-   set machine=ALPHA
-   set DEC=1
-else if ( `uname` == Linux && `hostname` != mercure ) then
-   set machine=LINUX
-   set LINUX=1
-else if ( `hostname` == atlas || `hostname` == axis  || `hostname` == etoile ) then
-   set machine=CRAY
-   set CRAY=1
-else if ( `uname` == SUPER-UX ) then
-   set machine=NEC
-   set NEC=1
-else if ( `hostname` == rhodes) then
-   set machine=XNEC
-   set XNEC=1
-else if ( `hostname` == mercure) then
-   set machine=X6NEC
-   set X6NEC=1
-else
-   echo Vous travaillez sur une machine non prevue par le reglement
-   exit
-endif
-
 if ( ! -d $libo )  then
    mkdir $libo
 endif
 
-
-if $VPP then
-set netcdf=netcdf_v
-else 
-set netcdf=netcdf
-endif
 ########################################################################
 #  Quelques initialisations de variables du shell.
@@ -165,5 +64,4 @@
 set adjnt=""
 set opt_dep=""
-set libchimie=""
 
 set optim=""
@@ -172,111 +70,84 @@
 set oplink=""
 
-########################################################################
-#  Optimisations par defaut suivant les machines
-########################################################################
-
-echo "Optimisations par defaut suivant les machines"
-set libf=$model/libf
-#setenv localdir "LOCAL_DIR=`pwd`"
-#setenv localdir "`pwd`"
-cd $model
-#############
-if $CRAY then
-#############
-#   set optim="-Wf'-ei' -dp -Wf'-a static'"
-   set optimbis=" -DCRAY "
-   set optim90="-Wp'-P' -DCRAY -p$IOIPSLDIR "'-p$(LIBO) -eiv '
-   set optim="$optim90"
-   set oplink="-Wl'-DSTACK=128 -f indef' -L$IOIPSLDIR -lioipsl  -L$NCDFLIB -lnetcdf "
-   set mod_loc_dir=" "
-   set mod_suffix=" "
-#################
-else if $SUN then
-#################
-   set optim=" -fast "
-   set optimbis=" "
-   set optim90=" -fast -fixed "
-   set optimtru90=" -fast -free "
-   set opt_link="-lf77compat -L$MODIPSLDIR -lsechiba -lparameters -lstomate -lioipsl -L$NCDFLIB -lnetcdf "
-   set mod_loc_dir=$localdir
-   set mod_suffix=mod
-#################
-else if $HP then
-#################
-   set optim=" +U77 -O +E1 "
-   set optimbis=" "
-#################
-else if $IBM then
-#################
-   set optim=" -O3 -qtune=pwr2 -qarch=pwr2"
-   set optimbis=" "
-#################
-else if $VPP then
-#################
-#   set optim="-Dasuxm  -On, -g -Ad -Potilax -Eciplume -Si"
-#   set optimbis="  -Wv,-m3 -Wp,-DVPP -Z $LMDGCM/listage"
-   set optimbis=" -Wp,-DNC_DOUBLE -Ad -Z $LMDGCM/listage -X9"
-   set optim90="$optim $optimbis -X9 -w"
-   set mod_loc_dir=$MODIPSLDIR
-   set mod_suffix=mod
-#################
-else if $DEC then
-#################
-   set optim=" "
-   set optimbis=" "
-#################
-else if $LINUX then
-#################
-   if ( $FC_LINUX == "pgf90" ) then
-     set optim="-fast "
-     set optim90=" -fast "
-#   set optimtru90=" -fast -c -Mfree -module $MODIPSLDIR "
-     set optimtru90=" -fast -c -Mfree "
-   else if ( $FC_LINUX == 'g95' ) then 
-     set optim=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic "
-     set optim90=" $OPT_LINUX -fno-second-underscore -ffixed-form -fstatic "
-     set optimtru90=" $OPT_LINUX -fno-second-underscore -ffree-form -fstatic "
-   else
-     echo 'compilateur linux non reconnu'
-     exit
-   endif
-   set mod_loc_dir=$MODIPSLDIR
-   set mod_suffix=mod
-#################
-else if $NEC then
-#################
-   set optim90=' -clear -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
-   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P static -Wf,"-pvctl fullmsg noassume "'
-   set optim="$optim90"
-   set optimbis=" "
-   set opt_link=" -C hopt -float0 -ew -P static -L$MODIPSLDIR -lioipsl  $NCDFLIB -lnetcdf_i8r8_v "
-   set mod_loc_dir="."
-   set mod_suffix="mod"
-#################
-else if $XNEC then
-#################
-   set optdbl='-dw -Wf\"-A dbl4\"'
-   set optim90=' -clear -float0 -f3 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume "'
-   set optimtru90=' -clear -f4 -float0 -Ep -DNC_DOUBLE -dw -Wf\"-A dbl4\" -R2 -R3 -R4 -R5 -Wf,"-pvctl loopcnt=40000 fullmsg noassume"'
-   set optim="$optim90"
-   set optimbis=" "
-   set mod_suffix="mod"
-   set mod_loc_dir="./"
-#################
-else if $X6NEC then
-#################
-   set optdbl='-dw -Wf\"-A dbl4\"'  
-   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 "'
-   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"'
-   set optim="$optim90"
-   set optimbis=" "
-   set mod_suffix="mod"
-   set mod_loc_dir="./"
-else
-   set optim=""
-   set optimbis=" "
-endif
-
-set nomlib=$machine
+
+########################################################################
+# options du compilateur
+########################################################################
+
+  set machine=SX6
+  set f77=sxf90.new
+  set f90=sxf90.new
+  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'
+  set optimtru90="$optim90"
+  set optim="$optim90"
+  set cppflags='-DNC_DOUBLE -DBLAS -DSGEMV=DGEMV -DSGEMM=DGEMM'
+  set opt_link='-float0 -size_t64 -Wf,-A dbl4 -lblas'
+  set mod_suffix="mod"
+  set mod_loc_dir="./"
+  set make="sxmake -i RANLIB=ls"
+  set link="$f90 -Wl,-hlib_cyclic"   
+  set ar=sxar
+  set optim90="$optim90 -f3"
+  
+########################################################################
+# options par defaut pour la commande make
+########################################################################
+
+  set dim="96x72x19"
+  set physique=lmd
+  set phys="PHYS=$physique" 
+  set include='-I$(LIBF)/filtrez -I$(LIBF)/grid -I$(LIBF)/bibio -I. '
+  set ntrac = 4
+  set filtre=filtrez
+  set grille=reg
+  set couple=false
+  set veget=false
+  set psmile=false
+  set io=ioipsl
+  set inca=false
+  set vampir=false
+  set parallel=false
+  
+  if ($parallel == true) then
+    set cppflags = " $cppflags -DCPP_PARA"
+    set include="$include"' -I$(LIBF)/dyn3d_par'
+  else
+    set include="$include"' -I$(LIBF)/dyn3d'
+  endif
+   
+  if ($inca == true) then
+    set cppflags="$cppflags -DINCA -DINCA_CH4"
+    set opt_link="$opt_link -linca"
+  endif
+
+  if ($couple == true) then
+     set opt_link="$opt_link -L/scratchdir/p86yann/MODIPSL_NEW/modipsl/prism/SX/lib -lpsmile.MPI2 -lmpp_io"
+     set cppflags="$cppflags -DCPP_COUPLE -DCPP_PSMILE -I/scratchdir/p86yann/MODIPSL_NEW/modipsl/prism/SX/build/lib/psmile.MPI2"
+  endif
+
+  if ($veget == true) then
+     set opt_link="$opt_link -L $ORCH_LIBDIR -lsxparameters -lsxsechiba -lsxstomate -lsxparallel"
+     set cppflags="$cppflags -DCPP_VEGET"
+     set include="$include"" -I$ORCH_LIBDIR"
+  endif
+ 
+  if ($vampir == true) then 
+    set cppflags="$cppflags -vt -DUSE_VT"
+    set opt_link="$opt_link -vt"
+  else
+    set cppflags="$cppflags -DNUSE_VT"
+    set opt_link="$opt_link"
+  endif
+  
+  set optim90=" $optim90  -I$libo $cppflags"
+  set optimtru90=" $optimtru90 -I$libo $cppflags"
+  set optim=" $optim  -I$libo $cppflags"
+  set opt_link="$opt_link -L$IOIPSLDIR -lsxioipsl -L$NCDFLIB -lnetcdf"
+  
+########################################################################
+#  Les differentes platformes reconnues
+########################################################################
+set X6NEC=1
+
 
 ########################################################################
@@ -360,12 +231,6 @@
            pour selectionner le mode psmile ou non (par defaut)
 
--parallel  false|true
-           pour selectionner le mode parallele ou non (false par defaut)
-
 -v true|false
            pour selectionner la vegetation (par defaut) ou non
-
--chimie CH4|CH4_AER|NMHC|NMHC_AER|AER|GES|false
-	   pour selectionner ou non la chimie (par defaut sans)
 
 -g grille  selectionne le type de grille qu'on veut utiliser.
@@ -433,15 +298,5 @@
 
      case -psmile
-        set psmile="$2" 
-	if ( "$psmile" == 'true' ) then
-	  set couple='true'
-	endif
-	shift ; shift ; goto top
-
-     case -chimie
-	set chimie="$2" ; shift ; shift ; goto top
-
-     case -parallel
-        set parallel="$2" ; shift ; shift ; goto top
+        set psmile="$2" ; shift ; shift ; goto top
   
      case -t
@@ -462,29 +317,5 @@
 
      case -debug
-        if $HP then
-           set optim=" -g "
-        else if $SUN then
-           setenv PARALLEL 2
-# Il faut rajouter l'option -dalign a -g pour pouvoir editer les liens
-# avec des programmes compiles avec -fast
-           set optim=" -g -dalign "
-           set optim90=" -fixed -g "
-           set optimtru90=" -free -g -C -dalign "
-        else if $CRAY then
-           set optim="$optim"" -g "
-           set optim90="$optim90"" -G1 "
-        else if $LINUX then
-           if ( $FC_LINUX == "pgf90" ) then
-             set optim="$optim"" -g -C -Mbounds "
-             set optim90="$optim90"" -g -C -Mbounds "
-             set optimtru90="$optimtru90"" -g -C -Mbounds "
-           else if ( $FC_LINUX == 'g95' ) then
-             set optim="$optim"" -g -fbounds-check "
-             set optim90="$optim90"" -g -fbounds-check "
-             set optimtru90="$optimtru90"" -g -fbounds-check "
-           else
-             echo 'compilateur linux non reconnu'
-             exit
-           endif
+        if $X6NEC then
         else 
            echo pas d option debug predefinie pour cette machine
@@ -505,5 +336,5 @@
 if ( $io == ioipsl ) then
    set optim="$optim -DCPP_IOIPSL"
-   set optim90="$optim"
+   set optim90="$optim90 -DCPP_IOIPSL"
    set optimtru90="$optimtru90 -DCPP_IOIPSL"
 endif
@@ -513,62 +344,20 @@
 else
    set optim="$optim -DCPP_PHYS"
-   set optim90="$optim"
+   set optim90="$optim90 -DCPP_PHYS"
    set optimtru90="$optimtru90 -DCPP_PHYS"
 endif
 
-set link_veget=" "
-if ( "$veget" == 'true' ) then
-   set optim="$optim -DCPP_VEGET"
-   set optim90="$optim"
-   set optimtru90="$optimtru90 -DCPP_VEGET"
-   set link_veget=" -lsechiba -lparameters -lstomate"
-   if ( $XNEC ) then
-      set link_veget=" -lsxsechiba -lsxparameters -lsxstomate"
-   endif
-endif
-
-if ( "$chimie" == 'CH4' ) then
-    set optim="$optim -DINCA -DINCA_CH4 "
-    set optim90="$optim"
-else if ( "$chimie" == 'CH4_AER' ) then
-    set optim="$optim -DINCA -DINCA_CH4 -DINCA_AER"
-    set optim90="$optim"
-else if ( "$chimie" == 'NMHC' ) then
-    set optim="$optim -DINCA -DINCA_NMHC "
-    set optim90="$optim"
-else if ( "$chimie" == 'NMHC_AER' ) then
-    set optim="$optim -DINCA -DINCA_NMHC -DINCA_AER"
-    set optim90="$optim"
-else if ( "$chimie" == 'AER' ) then
-    set optim="$optim -DINCA -DINCA_AER"
-    set optim90="$optim"
-else if ("$chimie" == 'GES' ) then
-    set optim="$optim -DINCA" 
-    set optim90="$optim"
-endif
-if ( "$chimie" == 'CH4' || "$chimie" == 'CH4_AER' || "$chimie" == 'NMHC' || "$chimie" == 'NMHC_AER' || "$chimie" == 'AER' || "$chimie" == 'GES' ) then
-    set opt_dep="$opt_dep chimie" 
-    set libchimie="-lchimie"
-    if ( $XNEC || $X6NEC ) then
-      set libchimie="-lsxchimie"
-    endif
-endif
-    
-if ( "$couple" == 'true' ) then
-   set optim="$optim -DCPP_COUPLE"
-   set optim90="$optim90 -DCPP_COUPLE"
-   set optimtru90="$optimtru90 -DCPP_COUPLE"
-endif
-
-if ( "$psmile" == 'true' ) then
-   set optim="$optim -DCPP_PSMILE"
-   set optim90="$optim90 -DCPP_PSMILE"
-   set optimtru90="$optimtru90 -DCPP_PSMILE"
-endif
-
-if ( "$parallel" == 'true' ) then
-   set optim="$optim -DCPP_PARALLEL"
-   set optim90="$optim90 -DCPP_PARALLEL"
-   set optimtru90="$optimtru90 -DCPP_PARALLEL"
+#set link_veget=" "
+#if ( "$veget" == 'true' ) then
+#   set optim="$optim -DCPP_VEGET"
+#   set optim90="$optim90 -DCPP_VEGET"
+#   set optimtru90="$optimtru90 -DCPP_VEGET"
+#   set link_veget=" -lsechiba -lparameters -lstomate"
+#endif
+
+if ($parallel == 'true') then
+  set FLAG_PARA='_par'
+else
+  set FLAG_PARA=''
 endif
 
@@ -612,28 +401,9 @@
    set suf=$suf$i
 end
-if ( ! $IBM ) then
-   set nomlib="$nomlib$suf"
-endif
-if ( $DEC ) then
-   set nomlib=DEC
-endif
-if ( $IBM ) then
-   set dim=`echo $dim | sed -en 's/[^0-9]/ /g'`
-   set dim_=`echo $dim | sed -en 's/[^0-9]/_/g'`
-else if ( $SUN ) then
-   set dim=`echo $dim | sed -e 's/[^0-9]/ /g'` 
-   set dim_=`echo $dim | sed -e 's/[^0-9]/_/g'`
-else
+
    set dim=`echo $dim | sed -n -e 's/[^0-9]/ /gp'`
    set dim_=`echo $dim | sed -n -e 's/[^0-9]/_/gp'`
-endif
-set nomlib=${nomlib}${physique}_${dim_}_t${ntrac}_$grille
-## M-A-F nomlib trop long sur CRAY pour ar
-if ( $CRAY ) then
-    set nomlib=F90_${dim_}_t${ntrac}
-endif
-if ( $NEC || $XNEC || $X6NEC) then
-    set nomlib=F90_${dim_}_t${ntrac}
-endif
+   set nomlib=`echo ${machine}_${dim_}_t${ntrac}`
+
 echo calcul de la dimension
 set dimc=`echo $dim | wc -w`
@@ -643,5 +413,5 @@
 set dimh=$dim
 else
-set include="$include "'-I$(LIBF)/dyn3d '
+set include="$include "
 set dimh=`echo $dim | awk ' { print $1 "." $2 } '`
 endif
@@ -652,10 +422,6 @@
 ########################################################################
 
-if ( $XNEC ) then
   set include="$include -I$NCDFINC -I$IOIPSLDIR"
-else
-  set include="$include -I$NCDFINC -I$IOIPSLDIR"
-endif
-echo $include
+  echo $include
 
 ########################################################################
@@ -679,5 +445,5 @@
 
 cd dimension
-./makdim $ntrac $dim
+makdim $ntrac $dim
 cat $libf/grid/dimensions.h
 
@@ -742,45 +508,22 @@
 ########################################################################
 if ( $couple == 'true' ) then
-  banner couple
   pwd
-  if ( "$psmile" == 'true' ) then
-     if ( -f $libf/phy$physique/oasis.F ) then 
-	\rm $libf/phy$physique/oasis.F 
-     endif
-     if ( ! -f $libf/phy$physique/oasis.F90 ) then
-       \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90	
-     endif
-     if ( `diff $libf/phy$physique/oasis.F90 $libf/phy$physique/oasis.psmile | wc -w` ) then
-       \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90
-     endif
-  else
-     if ( -f $libf/phy$physique/oasis.F90 ) then
-       \rm $libf/phy$physique/oasis.F90
-     endif
-     if (! -f $libf/phy$physique/oasis.F ) then
-       \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F
-     else
-       if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then
-#         \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy
-         \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F
-       endif
-     endif
-  endif
+#  if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true | wc -w` ) then
+#   \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy
+#   \cp $libf/phy$physique/oasis.true $libf/phy$physique/oasis.F
+#  endif
+   if ( -f $libf/phy$physique/oasis.F ) then 
+     rm -f $libf/phy$physique/oasis.F
+   endif	
+   \cp $libf/phy$physique/oasis.psmile $libf/phy$physique/oasis.F90
 else
-  if ( -f $libf/phy$physique/oasis.F90 ) then
-    \rm $libf/phy$physique/oasis.F90
-  endif
-  if (! -f $libf/phy$physique/oasis.F ) then
-    \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F
-  else
-    if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then
-      \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true
-      \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F
-    endif
-  endif
+  if ( `diff $libf/phy$physique/oasis.F $libf/phy$physique/oasis.dummy | wc -w` ) then
+   \cp $libf/phy$physique/oasis.F $libf/phy$physique/oasis.true
+   \cp $libf/phy$physique/oasis.dummy $libf/phy$physique/oasis.F
+  endif
+   rm -f $libf/phy$physique/oasis.F90
 endif
 ########################################################################
 #  Avant de lancer le make, on recree le makefile si necessaire
-########################################################################
 ########################################################################
 # c'est a dire dans 3 cas:
@@ -791,31 +534,5 @@
 # 3. Si le makefile n'existe pas.
 ########################################################################
-##########################################
-# On adapte d'abord certains include à F90
-##########################################
-sed -e 's/^c/\!/' $libf/grid/dimensions.h >! $libf/grid/dimensions90.tmp
-if ( ! -f $libf/grid/dimensions90.h || `diff $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h | wc -w` ) then
-      \mv $libf/grid/dimensions90.tmp $libf/grid/dimensions90.h
-endif
-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
-# 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
-if ( ! -f $libf/dyn3d/paramet90.h || `diff $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h | wc -w` ) then
-      \mv $libf/dyn3d/paramet90.tmp $libf/dyn3d/paramet90.h
-endif
-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
-#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
-if ( ! -f $libf/dyn3d/control.inc  || `diff $libf/dyn3d/control.tmp $libf/dyn3d/control.inc | wc -w` ) then
-      \mv $libf/dyn3d/control.tmp $libf/dyn3d/control.inc
-endif
-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
-if ( ! -f $libf/phylmd/YOMCST.inc  || `diff $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc | wc -w` ) then
-      \mv $libf/phylmd/YOMCST.tmp $libf/phylmd/YOMCST.inc
-endif
-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
-if ( ! -f $libf/phylmd/clesphys.inc  || `diff $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc | wc -w` ) then
-      \mv $libf/phylmd/clesphys.tmp $libf/phylmd/clesphys.inc
-endif
-#sed -e 's/^c/\!/' $libf/dyn3dpar/paramet.h >! $libf/dyn3dpar/paramet90.h
-##########################################
+
 cd $model
 find libf -name '*.[Fh]' -print >! tmp77
@@ -850,153 +567,6 @@
 echo OPLINK="$oplink"
 
-#################
-if $HP then
-#################
-   set f77='fort77 +OP'
-   set f90='jensaisrien'
-   set opt_link="$opt_link -lm"
-#################
-else  if $VPP then
-#################
-   set f77=frt
-   set f90=$f77
-   if ($couple == true) then
-     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"
-     set oplink="-Wl,-t,-P,-dy "
-   else
-     set opt_link="-Wg,-c -L$MODIPSLDIR -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a"
-     set oplink="-Wl,-t,-dy "
-   endif
-   if ($veget == true) then
-     set opt_link="$opt_link $link_veget -lioipsl /usr/local/lib/lib64/libnetcdf_cc_31.a"
-   endif
-#################
-else if $CRAY then
-#################
-   set f77=f90
-   set f90=f90
-#################
-else if $LINUX then
-#################
-#   set f77=pgf90
-#   set f90=pgf90
-   set f77=$FC_LINUX
-   set f90=$FC_LINUX
-   if ( $FC_LINUX == 'pgf90' ) then
-   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/"
-   else if ($FC_LINUX == 'g95') then
-     set opt_link="-L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf -lioipsl -lnetcdf "
-   else
-     set opt_link=" "
-   endif
-#################
-else if $SUN then
-#################
-   set f77=f90
-   set f90=f90
-   set opt_link="-lf77compat -L$MODIPSLDIR $link_veget -lioipsl -L$NCDFLIB -lnetcdf "
-#################
-else if $NEC then
-#################
-   set f77=f90 -ftrace
-   set f90=f90 -ftrace
-   set opt_link="-L$MODIPSLDIR"
-   if ($veget == true) then
-     set opt_link="$opt_link $link_veget"
-   endif
-   if ($couple == true) then
-     set opt_link="$opt_link -lioipsl -loasis2.4_mpi2 -float0 -ew -P static $NCDFLIB "
-   else
-     set opt_link="$opt_link -L$MODIPSLDIR -lioipsl -float0 -ew -P static $NCDFLIB "
-   endif
-   set mod_loc_dir="./"
-#################
-else if $XNEC then
-#################
-   set f77="sxmpif90 -ftrace"
-   set f90="sxmpif90 -ftrace"
-   if $MODIPSL then
-     set opt_link="-L$MODIPSLDIR"
-     if ($veget == true) then
-       set opt_link="$opt_link $link_veget"
-     endif
-     if ($couple == true) then
-       if ($psmile == true) then
-       set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB "
-       else
-       set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB "
-       endif
-     else
-       set opt_link="$opt_link -lsxioipsl -float0 $optdbl -P static $NCDFLIB "
-     endif
-   else
-     if ($couple == true) then
-       set opt_link="-L$MODIPSLDIR"
-       set opt_link="$opt_link $link_veget -lsxioipsl -loasis2.4_mpi2 -float0 $optdbl -P static $NCDFLIB "
-     else
-       set opt_link=" -C hopt -float0 $optdbl -P static -L$MODIPSLDIR $link_veget -lsxioipsl $NCDFLIB "
-     endif
-   endif
-   set mod_loc_dir="./"
-##################
-else if $X6NEC then
-##################
-   set f77=sxmpif90
-   set f90=sxmpif90
-   if $MODIPSL then
-     set opt_link="-L$MODIPSLDIR"
-     if ($veget == true) then
-       set opt_link="$opt_link -lsxsechiba -lsxparameters -lsxstomate"
-     endif
-     if ($couple == true) then
-	if ($psmile == true) then
-	set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB "
-	else
-	set opt_link="$opt_link -lsxioipsl -loasis2.4_mpi2 -float0 -size_t64 $optdbl -P static $NCDFLIB "
-	endif
-     else
-       set opt_link="$opt_link -lsxioipsl -float0 -size_t64 $optdbl -P static $NCDFLIB "
-     endif
-   else
-#     set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxsechiba -lsxparameters -lsxstomate -lsxioipsl $NCDFLIB "
-     set opt_link=" -float0 -size_t64 $optdbl -P static -L$MODIPSLDIR -lsxioipsl $NCDFLIB "
-
-   endif
-   set mod_loc_dir="./"
-#################
-else
-#################
-   set f77=f77
-   set f90=f90
-endif
-
-cd $model
-
-if $VPP then
-set make="gmake RANLIB=ls"
-else if $CRAY then
-set make="make RANLIB=ls"
-else if $NEC then
-set make="make RANLIB=ls"
-else if $LINUX then
-set make="make -k RANLIB=ranlib"
-else if $XNEC then
-set make="gmake RANLIB=ls"
-else if $X6NEC then
-set make="gmake RANLIB=ls"
-else
-set make="make RANLIB=ranlib"
-endif
-
-
-
-
-#
-# etat0_netcdf a besoin d'info de la physique
-# A revoir
+
 set include="$include"' -I$(LIBF)/phy'"$physique"
-#
-# le programme principal create_limit a besoin de l'info du module
-# startvar: on met donc libo dans les include pour Nec
 set include="$include"' -I$(LIBO)'
 
@@ -1006,47 +576,4 @@
 #################################################################
 
-if $VPP then
-  set optim90=" $optim90 -Am -M$libo"
-  set optimtru90="$optim90"
- \cp $IOIPSLDIR/*.mod $libo
-else if $SUN then
- set optim90=" $optim90 -M$libo -M$MODIPSLDIR "
- set optimtru90=" $optimtru90 -M$libo -M$MODIPSLDIR "
- set optim="$optim90"
- \cp $IOIPSLDIR/*.mod $libo
-else if $NEC then
- set optim90=" $optim90 -I$libo "
-else if $XNEC then
- set optim90=" $optim90 -I$libo "
- set optimtru90=" $optimtru90 -I$libo "
-else if $X6NEC then
- set optim90=" $optim90 -I$libo "
- set optimtru90=" $optimtru90 -I$libo "
-else if $LINUX then
- if ( $FC_LINUX == "pgf90" ) then
-   set optimtru90=" $optimtru90 -module $libo "
-   set optim90=" $optim90 -module $libo "
- else if ( $FC_LINUX == 'g95' ) then
-   set optimtru90=" $optimtru90 -fmod=$libo  "
-   set optim90=" $optim90 -fmod=$libo  "
- endif
- set optim="$optim90"
- set mod_loc_dir=$libo
- \cp /d3/fairhead/sechiba/ioipsl/*.mod $libo
- \cp $IOIPSLDIR/*.mod $libo
-endif
-
-set link="$f90 $optim90"
-
-set ar=ar
-
-if $XNEC then
-  set link="sxld $opt_link"
-  set link="$f90 "
-#  set ar=sxar
-else if $X6NEC then
-  set link="sxld $opt_link"
-  set link="$f90 "
-endif
 
 
@@ -1064,6 +591,6 @@
 $phys \
 DIM=$dimc \
+FLAG_PARA="$FLAG_PARA"\
 L_ADJNT="$adjnt" \
-L_CHIMIE="$libchimie" \
 LOCAL_DIR="$localdir"  \
 F77="$f77" \
@@ -1076,4 +603,5 @@
 AR=$ar \
 PROG=$code
+
 
 $make -f $LMDGCM/makefile \
@@ -1088,6 +616,6 @@
 $phys \
 DIM=$dimc \
+FLAG_PARA="$FLAG_PARA"\
 L_ADJNT="$adjnt" \
-L_CHIMIE="$libchimie" \
 LOCAL_DIR="$localdir"  \
 F77="$f77" \
