Index: trunk/LMDZ.MARS/README
===================================================================
--- trunk/LMDZ.MARS/README	(revision 145)
+++ trunk/LMDZ.MARS/README	(revision 146)
@@ -649,2 +649,8 @@
 >> minor bug correction in writeg1d (JYC)
 >> add "-check" to debug option in makegcm_ifort
+
+== 08/06/2011 == EM
+>> minor bug fix in lect_start_archive.F (using wrong surface temp. array).
+   + swiched output messages to english and added that tracers not found
+   in file must be initialized by user.
+>> minor bug fix in datareadnc.F : 'datafile' path must be initialized.
Index: trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F
===================================================================
--- trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F	(revision 145)
+++ trunk/LMDZ.MARS/libf/dyn3d/lect_start_archive.F	(revision 146)
@@ -185,4 +185,5 @@
       integer :: counter
       character(len=30) :: txt ! to store some text
+      real :: tmpval ! to store a temporary variable/value
 
 c=======================================================================
@@ -350,5 +351,5 @@
       ierr = NF_INQ_VARID (nid, "controle", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "Lect_start_archive: champ <controle> est absent"
+         PRINT*, "Lect_start_archive: <controle> is missing"
          CALL abort
       ENDIF
@@ -359,5 +360,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echoue pour <controle>"
+         PRINT*, "lect_start_archive: Failed loading <controle>"
          CALL abort
       ENDIF
@@ -371,5 +372,5 @@
       ierr = NF_INQ_VARID (nid, "rlonv", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <rlonv> est absent"
+         PRINT*, "lect_start_archive: <rlonv> is missing"
          CALL abort
       ENDIF
@@ -380,5 +381,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <rlonv>"
+         PRINT*, "lect_start_archive: Failed loading <rlonv>"
          CALL abort
       ENDIF
@@ -386,5 +387,5 @@
       ierr = NF_INQ_VARID (nid, "rlatu", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <rlatu> est absent"
+         PRINT*, "lect_start_archive: <rlatu> is missing"
          CALL abort
       ENDIF 
@@ -395,5 +396,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <rlatu>"
+         PRINT*, "lect_start_archive: Failed loading <rlatu>"
          CALL abort
       ENDIF
@@ -401,5 +402,5 @@
       ierr = NF_INQ_VARID (nid, "rlonu", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <rlonu> est absent"
+         PRINT*, "lect_start_archive: <rlonu> is missing"
          CALL abort
       ENDIF
@@ -410,5 +411,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <rlonu>"
+         PRINT*, "lect_start_archive: Failed loading <rlonu>"
          CALL abort
       ENDIF
@@ -416,5 +417,5 @@
       ierr = NF_INQ_VARID (nid, "rlatv", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <rlatv> est absent"
+         PRINT*, "lect_start_archive: <rlatv> is missing"
          CALL abort
       ENDIF
@@ -425,5 +426,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <rlatv>"
+         PRINT*, "lect_start_archive: Failed loading <rlatv>"
          CALL abort
       ENDIF
@@ -436,5 +437,5 @@
       ierr = NF_INQ_VARID (nid, "aps", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <aps> est absent"
+         PRINT*, "lect_start_archive: <aps> is missing"
          apsold=0
          PRINT*, "<aps> set to 0"
@@ -446,5 +447,5 @@
 #endif
          IF (ierr .NE. NF_NOERR) THEN
-            PRINT*, "lect_start_archive: Lecture echouee pour <aps>"
+            PRINT*, "lect_start_archive: Failed loading <aps>"
          ENDIF
       ENDIF
@@ -452,5 +453,5 @@
       ierr = NF_INQ_VARID (nid, "bps", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <bps> est absent"
+         PRINT*, "lect_start_archive: <bps> is missing"
          PRINT*, "It must be an old start_archive, lets look for sig_s"
          ierr = NF_INQ_VARID (nid, "sig_s", nvarid)
@@ -466,5 +467,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <bps>"
+         PRINT*, "lect_start_archive: Failed loading <bps>"
          CALL abort
       END IF
@@ -555,5 +556,5 @@
       ierr = NF_INQ_VARID (nid, "phisinit", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <phisinit> est absent"
+         PRINT*, "lect_start_archive: <phisinit> is missing"
          CALL abort
       ENDIF
@@ -564,5 +565,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <phisinit>"
+         PRINT*, "lect_start_archive: Failed loading <phisinit>"
          CALL abort
       ENDIF
@@ -584,5 +585,5 @@
          ierr = NF_INQ_DIMID (nid, "temps", nvarid)
          IF (ierr .NE. NF_NOERR) THEN
-            PRINT*, "lect_start_archive: Le champ <Time> est absent"
+            PRINT*, "lect_start_archive: <Time> is missing"
             CALL abort
          endif
@@ -599,5 +600,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <Time>"
+         PRINT*, "lect_start_archive: Failed loading <Time>"
          CALL abort
       ENDIF
@@ -605,11 +606,11 @@
       write(*,*)
       write(*,*)
-      write(*,*) 'Differentes dates des etats initiaux stockes:'
-      write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
+      write(*,*) 'Dates of the stored initial states:'
+      write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
       pi=2.*ASIN(1.)
       do i=1,timelen
 c       call solarlong(timelist(i),sollong(i))
 c       sollong(i) = sollong(i)*180./pi
-        write(*,*) 'etat initial au jour martien' ,int(timelist(i))
+        write(*,*) 'initial state at martian day: ',int(timelist(i))
 c       write(*,6) nint(timelist(i)),nint(mod(timelist(i),669)),
 c    .    sollong(i)
@@ -619,5 +620,5 @@
  
       write(*,*)
-      write(*,*) 'Choix de la date'
+      write(*,*) 'Choose the martian day to use'
  123  read(*,*,iostat=ierr) date
       if(ierr.ne.0) goto 123
@@ -632,10 +633,10 @@
         write(*,*)
         write(*,*)
-        write(*,*) 'He alors... Y sait pas lire !?!'
+        write(*,*) 'Wrong value for day number !!'
         write(*,*)
-        write(*,*) 'Differentes dates des etats initiaux stockes:'
-        write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
+        write(*,*) 'Dates of the stored initial states:'
+        write(*,*) '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
         do i=1,timelen
-          write(*,*) 'etat initial au jour martien' ,nint(timelist(i))
+          write(*,*) 'initial state at martian day: ',nint(timelist(i))
 c         write(*,6) nint(timelist(i)),nint(mod(timelist(i),669))
         end do
@@ -657,5 +658,5 @@
       ierr = NF_INQ_VARID (nid, "co2ice", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <co2ice> est absent"
+         PRINT*, "lect_start_archive: <co2ice> is missing"
          CALL abort
       ENDIF
@@ -666,5 +667,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <co2ice>"
+         PRINT*, "lect_start_archive: Failed loading <co2ice>"
          PRINT*, NF_STRERROR(ierr)
          CALL abort
@@ -673,5 +674,5 @@
       ierr = NF_INQ_VARID (nid, "emis", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <emis> est absent"
+         PRINT*, "lect_start_archive: <emis> is missing"
          CALL abort
       ENDIF
@@ -682,5 +683,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <emis>"
+         PRINT*, "lect_start_archive: Failed loading <emis>"
          CALL abort
       ENDIF
@@ -688,5 +689,5 @@
       ierr = NF_INQ_VARID (nid, "ps", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <ps> est absent"
+         PRINT*, "lect_start_archive: <ps> is missing"
          CALL abort
       ENDIF
@@ -697,5 +698,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <ps>"
+         PRINT*, "lect_start_archive: Failed loading <ps>"
          CALL abort
       ENDIF
@@ -703,5 +704,5 @@
       ierr = NF_INQ_VARID (nid, "tsurf", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <tsurf> est absent"
+         PRINT*, "lect_start_archive: <tsurf> is missing"
          CALL abort
       ENDIF
@@ -712,5 +713,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <tsurf>"
+         PRINT*, "lect_start_archive: Failed loading <tsurf>"
          CALL abort
       ENDIF
@@ -718,5 +719,5 @@
       ierr = NF_INQ_VARID (nid, "q2surf", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <q2surf> est absent"
+         PRINT*, "lect_start_archive: <q2surf> is missing"
          CALL abort
       ENDIF
@@ -727,5 +728,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <q2surf>"
+         PRINT*, "lect_start_archive: Failed loading <q2surf>"
          CALL abort
       ENDIF
@@ -740,11 +741,7 @@
 c -------------------------------------------
 ! Surface tracers:      
-      do iq=1,nqmx
-        call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
-      enddo
+      qsurfold(1:imold+1,1:jmold+1,1:nqmx)=0
 
       DO iq=1,nqmx
-!      iq=nqold
-!        write(str2,'(i2.2)') iq
         IF (oldtracernames) THEN
           txt=" "
@@ -765,5 +762,7 @@
           PRINT*, "lect_start_archive: ",
      &              " Tracer <",trim(txt),"> not found"
-          CALL abort
+          print*, "which (constant) value should it be initialized to?"
+          read(*,*) tmpval
+          qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
         ENDIF
 #ifdef NC_DOUBLE
@@ -777,62 +776,10 @@
           PRINT*, "lect_start_archive: ",
      &             " Failed loading <",trim(txt),">"
-          write (*,*) trim(txt),'     set to 0'
-          call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
+          print*, "which (constant) value should it be initialized to?"
+          read(*,*) tmpval
+          qsurfold(1:imold+1,1:jmold+1,iq)=tmpval
         ENDIF
 
       ENDDO ! of DO iq=1,nqmx
-
-! The trick below is to read in tracer nqmx-1 (i.e. water ice)
-!      if ((nqold.gt.1).and.(nqmx.gt.1)) then
-!        iq=nqold-1
-!        write(str2,'(i2.2)') iq
-!         ierr = NF_INQ_VARID (nid, "qsurf"//str2, nvarid)
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Le champ <","qsurf"//str2,"> est absent"
-!            CALL abort
-!         ENDIF
-!#ifdef NC_DOUBLE
-!         ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
-!     .          qsurfold(1,1,nqmx-1))
-!#else
-!         ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
-!     .          qsurfold(1,1,nqmx-1))
-!#endif
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Lecture echouee pour <","qsurf"//str2,">"
-!            write (*,*) 'qsurf'//str2,' set to 0'
-!            call initial0((jmold+1)*(imold+1), qsurfold(1,1,nqmx-1))
-!         ENDIF
-!      endif
-
-! The trick below is to read in tracers except nqmx & nqmx-1 (water vap.& ice)
-!      if (nqold.gt.2) then
-!       do  iq = 1, nqold-2
-!       if (iq.lt.nqmx-1) then
-!         write(str2,'(i2.2)') iq
-!         ierr = NF_INQ_VARID (nid, "qsurf"//str2, nvarid)
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Le champ <","qsurf"//str2,"> est absent"
-!            CALL abort
-!         ENDIF
-!#ifdef NC_DOUBLE
-!         ierr = NF_GET_VARA_DOUBLE(nid, nvarid,start,count,
-!     .          qsurfold(1,1,iq))
-!#else
-!         ierr = NF_GET_VARA_REAL(nid, nvarid,start,count,
-!     .          qsurfold(1,1,iq))
-!#endif
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Lecture echouee pour <","qsurf"//str2,">"
-!            write (*,*) 'qsurf'//str2,' set to 0'
-!            call initial0((jmold+1)*(imold+1), qsurfold(1,1,iq))
-!         ENDIF
-!       end if
-!       end do
-!      end if
 
 !-----------------------------------------------------------------------
@@ -920,5 +867,5 @@
       ierr = NF_INQ_VARID (nid,"temp", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <temp> est absent"
+         PRINT*, "lect_start_archive: <temp> is missing"
          CALL abort
       ENDIF
@@ -929,5 +876,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <temp>"
+         PRINT*, "lect_start_archive: Failed loading <temp>"
          CALL abort
       ENDIF
@@ -935,5 +882,5 @@
       ierr = NF_INQ_VARID (nid,"u", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <u> est absent"
+         PRINT*, "lect_start_archive: <u> is missing"
          CALL abort
       ENDIF
@@ -944,5 +891,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <u>"
+         PRINT*, "lect_start_archive: Failed loading <u>"
          CALL abort
       ENDIF
@@ -950,5 +897,5 @@
       ierr = NF_INQ_VARID (nid,"v", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <v> est absent"
+         PRINT*, "lect_start_archive: <v> is missing"
          CALL abort
       ENDIF
@@ -959,5 +906,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <v>"
+         PRINT*, "lect_start_archive: Failed loading <v>"
          CALL abort
       ENDIF
@@ -965,5 +912,5 @@
       ierr = NF_INQ_VARID (nid,"q2atm", nvarid)
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Le champ <q2atm> est absent"
+         PRINT*, "lect_start_archive: <q2atm> is missing"
          CALL abort
       ENDIF
@@ -974,5 +921,5 @@
 #endif
       IF (ierr .NE. NF_NOERR) THEN
-         PRINT*, "lect_start_archive: Lecture echouee pour <q2atm>"
+         PRINT*, "lect_start_archive: Failed loading <q2atm>"
          CALL abort
       ENDIF
@@ -982,12 +929,8 @@
 c the others keep their rank. ! No longer true.
 c -------------------------------------------
-! Tracers:      
-      do iq=1,nqmx
-         call initial0((jmold+1)*(imold+1)*lmold,qold(1,1,1,iq) )
-      enddo
+! Tracers:
+      qold(1:imold+1,1:jmold+1,1:lmold,1:nqmx)=0
 
       DO iq=1,nqmx
-!      iq=nqold
-!        write(str2,'(i2.2)') iq
         IF (oldtracernames) THEN
           txt=" "
@@ -1001,5 +944,7 @@
             PRINT*, "lect_start_archive: ",
      &              " Tracer <",trim(txt),"> not found"
-            CALL abort
+          print*, "which (constant) value should it be initialized to?"
+          read(*,*) tmpval
+          qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
         ENDIF
 #ifdef NC_DOUBLE
@@ -1011,80 +956,11 @@
           PRINT*, "lect_start_archive: ",
      &             "  Failed loading <",trim(txt),">"
-          write (*,*) trim(txt),'      set to 1.E-30'
-          do l=1,lmold
-            do j=1,jmold+1
-              do i=1,imold+1
-                 qold(i,j,l,iq)=1.e-30
-              end do
-            end do
-          end do
+          print*, "which (constant) value should it be initialized to?"
+          read(*,*) tmpval
+          qold(1:imold+1,1:jmold+1,1:lmold,iq)=tmpval
         ENDIF
 
       ENDDO ! of DO iq=1,nqmx
 
-! The trick below is to read in tracer nqmx-1 (i.e. water ice)
-!      if ((nqold.gt.1).and.(nqmx.gt.1)) then
-!        iq=nqold-1
-!        write(str2,'(i2.2)') iq
-!         ierr = NF_INQ_VARID (nid, "q"//str2, nvarid)
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive:
-!     .               Le champ <","q"//str2,"> est absent"
-!            CALL abort
-!         ENDIF
-!#ifdef NC_DOUBLE
-!         ierr= NF_GET_VARA_DOUBLE(nid,nvarid,start,count,
-!     .                            qold(1,1,1,nqmx-1))
-!#else
-!         ierr= NF_GET_VARA_REAL(nid,nvarid,start,count,
-!     .                            qold(1,1,1,nqmx-1))
-!#endif
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Lecture echouee pour <","q"//str2,">"
-!            write (*,*) 'q'//str2,' set to 1.E-30'
-!            do l=1,lmold
-!              do j=1,jmold+1
-!                do i=1,imold+1
-!                   qold(1,1,1,nqmx-1)=1.e-30
-!                end do
-!              end do
-!            end do
-!
-!         ENDIF
-!      endif
-
-! The trick below is to read in tracers except nqmx & nqmx-1 (water vap.& ice)
-!      if (nqold.gt.2) then
-!       do  iq = 1, nqold-2
-!       if (iq.lt.nqmx-1) then
-!         write(str2,'(i2.2)') iq
-!         ierr = NF_INQ_VARID (nid, "q"//str2, nvarid)
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive:
-!     .               Le champ <","q"//str2,"> est absent"
-!            CALL abort
-!         ENDIF
-!#ifdef NC_DOUBLE
-!         ierr= NF_GET_VARA_DOUBLE(nid,nvarid,start,count,qold(1,1,1,iq))
-!#else
-!         ierr= NF_GET_VARA_REAL(nid,nvarid,start,count,qold(1,1,1,iq))
-!#endif
-!         IF (ierr .NE. NF_NOERR) THEN
-!            PRINT*, "lect_start_archive: 
-!     .               Lecture echouee pour <","q"//str2,">"
-!            write (*,*) 'q'//str2,' set to 1.E-30 '
-!            do l=1,lmold
-!              do j=1,jmold+1
-!                do i=1,imold+1
-!                   qold(1,1,1,iq)=1.e-30
-!                end do
-!              end do
-!            end do
-
-!         ENDIF
-!       end if
-!       end do
-!      end if
 
 c Chemin pour trouver les donnees de surface (albedo, relief, th.inertia...)
@@ -1157,11 +1033,11 @@
 
       write(*,*)
-      write(*,*)'Ancienne grille: masse de l atm :',ptotalold
-      write(*,*)'Nouvelle grille: masse de l atm :',ptotal
-      write (*,*) 'Ratio new atm./ old atm =', ptotal/ptotalold 
+      write(*,*)'Old grid: mass of the atmosphere :',ptotalold
+      write(*,*)'New grid: mass of the atmosphere :',ptotal
+      write (*,*) 'Ratio new atm / old atm =', ptotal/ptotalold 
       write(*,*)
-      write(*,*)'Ancienne grille: masse de la glace CO2:',co2icetotalold
-      write(*,*)'Nouvelle grille: masse de la glace CO2:',co2icetotal
-      write(*,*)'Ratio new ice./old ice =',co2icetotal/co2icetotalold
+      write(*,*)'Old grid: mass of CO2 ice:',co2icetotalold
+      write(*,*)'New grid: mass of CO2 ice:',co2icetotal
+      write(*,*)'Ratio new ice / old ice =',co2icetotal/co2icetotalold
       write(*,*)
 
@@ -1263,5 +1139,5 @@
 	 do j=1,jmold+1
 	   ! copy values
-	   oldval(1)=tsurfS(i,j)
+	   oldval(1)=tsurfold(i,j)
 	   oldval(2:nsoilold+1)=tsoilold(i,j,1:nsoilold)
 	   ! build vertical coordinate
@@ -1295,5 +1171,5 @@
 	 do j=1,jmold+1
 	   ! copy values
-	   oldval(1)=tsurfS(i,j)
+	   oldval(1)=tsurfold(i,j)
 	   oldval(2:nsoilold+1)=tsoilold(i,j,1:nsoilold)
 	  ! interpolate
Index: trunk/LMDZ.MARS/libf/phymars/datareadnc.F
===================================================================
--- trunk/LMDZ.MARS/libf/phymars/datareadnc.F	(revision 145)
+++ trunk/LMDZ.MARS/libf/phymars/datareadnc.F	(revision 146)
@@ -41,4 +41,7 @@
 c                   (rlatvd de 89 a -89)
 c=======================================================================
+
+! to use  'getin'
+       use ioipsl_getincom 
 
       implicit none
@@ -77,6 +80,5 @@
       REAL        zthe(imdp1*jmdp1)
 
-      INTEGER   lnblnk, ierr
-      EXTERNAL    lnblnk
+      INTEGER     ierr
 
       INTEGER   unit,nvarid
@@ -95,5 +97,4 @@
       DIMENSION string(4)
 
-      CHARACTER*80    file
 
 #include "lmdstd.h"
@@ -109,14 +110,17 @@
 c    Lecture NetCDF des donnees latitude et longitude
 c-----------------------------------------------------------------------
-      write(*,*) 'ouverture du fichier surface.nc'
-
-      ierr = NF_OPEN (datafile(1:lnblnk(datafile))//'/surface.nc',
+      write(*,*) 'datareadnc: opening file surface.nc'
+
+      datafile="/u/forget/WWW/datagcm/datafile" ! default path to surface.nc
+      call getin("datadir",datafile) ! but users may specify another path
+      
+      ierr = NF_OPEN (trim(datafile)//'/surface.nc',
      &  NF_NOWRITE,unit)
       IF (ierr.NE.NF_NOERR) THEN
         write(*,*)'Error : cannot open file surface.nc '
         write(*,*)'(in phymars/datareadnc.F)'
-        write(*,*)'It should be in :',datafile(1:lnblnk(datafile)),'/'
-        write(*,*)'1) You can change this directory address in '
-        write(*,*)'   file phymars/datafile.h'
+        write(*,*)'It should be in :',trim(datafile),'/'
+        write(*,*)'1) You can set this path in the callphys.def file:'
+        write(*,*)'   datadir=/path/to/the/datafiles'
         write(*,*)'2) If necessary surface.nc (and other datafiles)'
         write(*,*)'   can be obtained online on:'
@@ -176,5 +180,5 @@
       string(2) = 'thermal'
       if (relief.ne.'pla') then
-        write(*,*) ' La topographie est celle de MOLA'
+        write(*,*) ' MOLA topography'
         relief = 'MOL'
           string(3) = 'z'//relief
@@ -282,5 +286,5 @@
             phisinit(i)=1000.*phisinit(i)
       ENDDO
-      CALL dump2d(iimp1,jjp1,phisinit,'Altitude en m')
+      CALL dump2d(iimp1,jjp1,phisinit,'Altitude in m')
       CALL multscal(iimp1*jjp1,phisinit,g,phisinit)
 
