Index: /trunk/LMDZ.GENERIC/README
===================================================================
--- /trunk/LMDZ.GENERIC/README	(revision 648)
+++ /trunk/LMDZ.GENERIC/README	(revision 649)
@@ -654,3 +654,10 @@
 == 16/04/2012 == JL
 - Added consistency checks for calculations including water and global1d+diurnal.
-
+- Corrected small bugs in precipitation scheme
+
+== 04/05/2012 == JL
+- Correction a huge bug in newstart: rcp and cpp can now be changed in start.nc files and are the same as in startfi.nc; 
+       Even when starting from start and startfi files.
+   - rcp, cpp and mugaz can now be computed using gases.def in newstart
+- Correction of a bug arising in gcm.F when the solar days are long (thanks Melanie V.)
+
Index: /trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F	(revision 648)
+++ /trunk/LMDZ.GENERIC/libf/dyn3d/gcm.F	(revision 649)
@@ -409,5 +409,5 @@
              rday_ecri = rdaym_ini
            ELSE
-             rday_ecri = INT( rdayvrai )
+             rday_ecri = INT(rdaym_ini)+INT(day_ini)
            ENDIF
 c
Index: /trunk/LMDZ.GENERIC/libf/dyn3d/newstart.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/dyn3d/newstart.F	(revision 648)
+++ /trunk/LMDZ.GENERIC/libf/dyn3d/newstart.F	(revision 649)
@@ -176,7 +176,4 @@
 !      CHARACTER*80 :: visu_file
 
-!      cpp    = 744.499 ! for Mars, instead of 1004.70885 (Earth)
-!      preff  = 610.    ! for Mars, instead of 101325. (Earth)
-!      pa     = 20      ! for Mars, instead of 500 (Earth)
       cpp    = 0.
       preff  = 0.
@@ -246,4 +243,13 @@
       endif
 
+
+c=======================================================================
+c  INITIALISATIONS DIVERSES
+c=======================================================================
+! Load tracer names:
+      call iniadvtrac(nq,numvanle)
+      ! tnom(:) now contains tracer names
+! JL12 we will need the tracer names to read start in dyneta0
+
 c-----------------------------------------------------------------------
 c Lecture du tableau des parametres du run (pour la dynamique)
@@ -284,8 +290,33 @@
           tab_cntrl(i+50)=tab_cntrl_bis(i)
         enddo
-      write(*,*) 'printing tab_cntrl', tab_cntrl
-      do i=1,100
-        write(*,*) i,tab_cntrl(i)
-      enddo
+        write(*,*) 'printing tab_cntrl', tab_cntrl
+        do i=1,100
+          write(*,*) i,tab_cntrl(i)
+        enddo
+	
+        ! Lmodif set to 0 to disable modifications possibility in phyeta0                           
+        write(*,*) 'Reading file START'
+        fichnom = 'start.nc'
+        CALL dynetat0(fichnom,nqmx,vcov,ucov,teta,q,masse,
+     .       ps,phis,time)
+
+        write(*,*) 'Reading file STARTFI'
+        fichnom = 'startfi.nc'
+        CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqmx,
+     .        day_ini,time,
+     .        tsurf,tsoil,emis,q2,qsurf,   !) ! temporary modif by RDW
+     .        cloudfrac,totalfrac,hice)
+
+        ! copy albedo and soil thermal inertia
+        do i=1,ngridmx
+          albfi(i) = albedodat(i)
+	  do j=1,nsoilmx
+           ithfi(i,j) = inertiedat(i,j)
+	  enddo
+        ! build a surfithfi(:) using 1st layer of ithfi(:), which might
+        ! be neede later on if reinitializing soil thermal inertia
+          surfithfi(i)=ithfi(i,1)
+        enddo
+
       
       endif
@@ -332,4 +363,5 @@
      .            p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time)
       else if (choix_1.eq.1) then
+         Lmodif=1 ! Lmodif set to 1 to allow modifications in phyeta0                           
          call tabfi (nid_fi,Lmodif,tab0,day_ini,lllm,p_rad,
      .            p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time)
@@ -349,7 +381,4 @@
 c  INITIALISATIONS DIVERSES
 c=======================================================================
-! Load tracer names:
-      call iniadvtrac(nq,numvanle)
-      ! tnom(:) now contains tracer names
 ! Initialize global tracer indexes (stored in tracer.h)
       call initracer()
@@ -423,32 +452,6 @@
         ierr= NF_CLOSE(nid)
 
-      else if (choix_1.eq.1) then !  c'est l'appel a tabfi de phyeta0 qui
-                                  !  permet de changer les valeurs du 
-                                  !  tab_cntrl Lmodif=1
-        tab0=0
-        Lmodif=1 ! Lmodif set to 1 to allow modifications in phyeta0                           
-        write(*,*) 'Reading file START'
-        fichnom = 'start.nc'
-        CALL dynetat0(fichnom,nqmx,vcov,ucov,teta,q,masse,
-     .       ps,phis,time)
-
-        write(*,*) 'Reading file STARTFI'
-        fichnom = 'startfi.nc'
-        CALL phyetat0 (fichnom,tab0,Lmodif,nsoilmx,nqmx,
-     .        day_ini,time,
-     .        tsurf,tsoil,emis,q2,qsurf,   !) ! temporary modif by RDW
-     .        cloudfrac,totalfrac,hice)
-
-        ! copy albedo and soil thermal inertia
-        do i=1,ngridmx
-          albfi(i) = albedodat(i)
-	  do j=1,nsoilmx
-           ithfi(i,j) = inertiedat(i,j)
-	  enddo
-        ! build a surfithfi(:) using 1st layer of ithfi(:), which might
-        ! be neede later on if reinitializing soil thermal inertia
-          surfithfi(i)=ithfi(i,1)
-        enddo
-
+      else if (choix_1.eq.1) then 
+         !do nothing, start and startfi have already been read
       else 
         CALL exit(1)
Index: /trunk/LMDZ.GENERIC/libf/phystd/tabfi.F
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/tabfi.F	(revision 648)
+++ /trunk/LMDZ.GENERIC/libf/phystd/tabfi.F	(revision 649)
@@ -79,5 +79,4 @@
       INTEGER size
       CHARACTER modif*20
-
 
 c-----------------------------------------------------------------------
@@ -229,8 +228,8 @@
       write(*,*) '(31 et 32) iceradius : mean scat radius of CO2 snow'
       write(*,*) '(33 et 34) dtemisice : time scale for snow',
-     &           ' metamorphism'
+     &           '                       metamorphism'
       write(*,*) '(27)        tauvis : mean dust vis. reference ',
-     &           'opacity'
-      write(*,*) '(35)      volcapa : soil volumetric heat capacity'
+     &           '                     opacity'
+      write(*,*) '(35)     volcapa  : soil volumetric heat capacity'
       write(*,*) '(18)     obliquit : planet obliquity (deg)'
       write(*,*) '(17)     peri_day : periastron date (sols since Ls=0)'
@@ -238,10 +237,13 @@
       write(*,*) '(16)     apoastr  : max. star-planet (UA)'
       write(*,*) '(14)     year_day : length of year (in sols)'
-      write(*,*) '(5) rad : radius of the planet (m)'
-      write(*,*) '(6) omeg : planet rotation rate (rad/s)'
-      write(*,*) '(7) g : gravity (m/s2)'
-      write(*,*) '(8) mugaz : molecular mass of the atmosphere (g/mol)'
-      write(*,*) '(9) rcp : r/Cp'
-      write(*,*) '(10) daysec : length of a sol (s)'
+      write(*,*) '(5)      rad      : radius of the planet (m)'
+      write(*,*) '(6)      omeg     : planet rotation rate (rad/s)'
+      write(*,*) '(7)      g        : gravity (m/s2)'
+      write(*,*) '(8)      mugaz    : molecular mass '
+      write(*,*) '                       of the atmosphere (g/mol)'
+      write(*,*) '(9)      rcp      : r/Cp'
+      write(*,*) '(8)+(9)  calc_cpp_mugaz : r/Cp and mugaz '
+      write(*,*) '                 computed from gases.def'
+      write(*,*) '(10)     daysec   : length of a sol (s)'
       write(*,*)
  
@@ -460,4 +462,17 @@
           write(*,*) ' cpp (new value):',cpp
 
+        else if (modif(1:len_trim(modif)).eq.'calc_cpp_mugaz') then
+          write(*,*) 'current value rcp, mugaz:',rcp,mugaz
+          check_cpp_match=.false.
+	  force_cpp=.false.
+	  call su_gases
+	  call calc_cpp_mugaz
+          write(*,*) 
+          write(*,*) ' cpp (new value):',cpp
+          write(*,*) ' mugaz (new value):',mugaz
+          r=8.314511/(mugaz/1000.0)
+          rcp=r/cpp
+          write(*,*) ' rcp (new value):',rcp
+	  
         else if (modif(1:len_trim(modif)).eq.'daysec') then
           write(*,*) 'current value:',daysec
