Index: /LMDZ.3.3/trunk/makegcm
===================================================================
--- /LMDZ.3.3/trunk/makegcm	(revision 105)
+++ /LMDZ.3.3/trunk/makegcm	(revision 106)
@@ -18,30 +18,45 @@
 # set LMDGCM=$HOME/LMDZ.3.3
 #
-#   a changer  rlmd304/agcm
-#
-###### VERSION LMDZ.3.2
-
-if ( ! $?LMDGCM ) then
-   echo You must initialize the variable LMDGCM in your environnement
-   echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc
-   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
-endif
-if ( ! $?NCDFLIB ) then
-   echo You must initialize the variable NCDFLIB in your environnement
-   echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc
-   exit
-endif
-if ( ! $?NCDFINC ) then
-   echo You must initialize the variable NCDFINC in your environnement
-   echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc
-   exit
+
+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
+  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
+    echo 'Probleme de definition des variables NCDFINC et NCDFLIB'
+  endif 
+else
+  if ( ! $?LMDGCM ) then
+    echo You must initialize the variable LMDGCM in your environnement
+    echo for instance: "setenv LMDGCM /usr/myself/supergcm" in .cshrc
+    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
+  endif
+  if ( ! $?NCDFLIB ) then
+    echo You must initialize the variable NCDFLIB in your environnement
+    echo for instance: "setenv NCDFLIB /usr/myself/netcdf" in .cshrc
+    exit
+  endif
+  if ( ! $?NCDFINC ) then
+    echo You must initialize the variable NCDFINC in your environnement
+    echo for instance: "setenv NCDFINC /usr/myself/netcdf" in .cshrc
+    exit
+  endif
 endif
 set model=$LMDGCM
@@ -60,4 +75,5 @@
 set LINUX=0
 set NEC=0
+set XNEC=0
 if ( `uname` == HP-UX ) then
    set machine=HP
@@ -84,4 +100,7 @@
    set machine=NEC
    set NEC=1
+else if ( `hostname` == rhodes) then
+   set machine=XNEC
+   set XNEC=1
 else
    echo Vous travaillez sur une machine non prevue par le reglement
@@ -120,5 +139,5 @@
 set libf=$model/libf
 #setenv localdir "LOCAL_DIR=`pwd`"
-setenv localdir "`pwd`"
+#setenv localdir "`pwd`"
 cd $model
 if $CRAY then
@@ -165,4 +184,5 @@
 else if $NEC then
    set optim90=' -clear -C hopt -float0 -ew -P stack -Wf,"-pvctl fullmsg noassume "'
+   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P stack -Wf,"-pvctl fullmsg noassume "'
    set optim="$optim90"
    set optimbis=" "
@@ -170,4 +190,18 @@
    set mod_loc_dir="."
    set mod_suffix="mod"
+else if $XNEC then
+   set optim90=' -clear -C hopt -float0 -ew -P stack -Wf,"-pvctl fullmsg noassume "'
+   set optimtru90=' -clear -f4 -C hopt -float0 -ew -P stack -Wf,"-pvctl fullmsg noassume "'
+   set optim="$optim90"
+   set optimbis=" "
+   if $MODIPSL then
+     set opt_link="-L$IOIPSLDIR -lsxioipsl -float0 -ew -P stack -I$NCDFINC $NCDFLIB "
+     set mod_loc_dir="$localdir/../lib"
+   else
+     set opt_link=" -C hopt -float0 -ew -P stack -L$IOIPSLDIR -lioipsl -L /u/rech/psl/rpsl003/IOIPSL -lnetcdf_i8r8_v -I$NCDFINC "
+     set mod_loc_dir="."
+   endif
+   set mod_suffix="mod"
+
 else
    set optim=""
@@ -404,5 +438,5 @@
     set nomlib=F90_${dim_}_t${ntrac}
 endif
-if ( $NEC ) then
+if ( $NEC || $XNEC ) then
     set nomlib=F90_${dim_}_t${ntrac}
 endif
@@ -567,4 +601,7 @@
    set f77=f90
    set f90=f90
+else if $XNEC then
+   set f77=sxmpif90
+   set f90=sxmpif90
 else
    set f77=f77
@@ -582,4 +619,6 @@
 else if $LINUX then
 set make="make -k RANLIB=ranlib"
+else if $XNEC then
+set make="gmake RANLIB=ls"
 else
 set make="make RANLIB=ranlib"
@@ -646,4 +685,7 @@
 else if $NEC then
  set optim90=" $optim90 -I$libo "
+else if $XNEC then
+ set optim90=" $optim90 -I$libo "
+ set optimtru90=" $optimtru90 -M$libo "
 else if $LINUX then
  set optim90=" -fast -module $libo "
@@ -656,8 +698,9 @@
 set link="$f90 $optim90"
 
-#if $NEC then
-#  set link="sxld $opt_link"
-#  set ar=sxar
-#endif
+if $XNEC then
+  set link="sxld $opt_link"
+  set link="$f90 "
+  set ar=sxar
+endif
 
 
@@ -684,4 +727,5 @@
 MOD_LOC_DIR=$mod_loc_dir \
 MOD_SUFFIX=$mod_suffix \
+AR=$ar \
 PROG=$code
 
@@ -706,4 +750,5 @@
 MOD_LOC_DIR=$mod_loc_dir \
 MOD_SUFFIX=$mod_suffix \
+AR=$ar \
 PROG=$code
 
