Index: trunk/LMDZ.VENUS/libf/phyvenus/load_psi.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/load_psi.F	(revision 927)
+++ 	(revision )
@@ -1,145 +1,0 @@
-      SUBROUTINE load_psi( 
-     S              psurf, ztop, ksive,
-     S              temp, psimap, deltapsimap)
-      
-      use dimphy
-      IMPLICIT none
-
-#include "dimensions.h"
-#include "YOMCST.h"
-#include "comcstVE.h"
-C
-C     ------------------------------------------------------------------
-C
-C     PURPOSE.
-C     --------
-C
-c     This routine loads the longwave matrix of factors Ksi
-c     (interpolated for a given column)
-c     to build the Net Exchange Rates matrix Psi.
-c     Psi(i,j,nu) = Ksi(i,j,nu) * ( B(i,nu)-B(j,nu) )
-c     
-c     The Ksi matrixes have been computed by Vincent Eymet
-C
-c     The NER matrix is then integrated in frequency.
-c
-C     AUTHOR.
-C     -------
-C        Sebastien Lebonnois
-C
-C     MODIFICATIONS.
-C     --------------
-C        version multimatrice (topographie, sommet nuages): 20/12/2006
-C     ------------------------------------------------------------------
-C
-C* ARGUMENTS:
-C
-c inputs
-      real   psurf(klon)           ! Surface pressure
-      real   ztop(klon)            ! Altitude of the top of cloud deck (km)
-      real   ksive(0:klev+1,0:klev+1,nnuve,nbmat)  ! ksi matrixes in Vincent's file
-      real   temp(klon,0:klev+1)  ! Temperature in layer (K)
-c outputs
-      real   psimap(0:klev+1,0:klev+1,klon)
-      real   deltapsimap(0:klev+1,0:klev+1,klon)
-
-c local variables
-      integer i,j,ig,band,nlve
-      integer mat,m,mat0
-      character*100 file
-      real   bplck(0:klev+1,nnuve)    ! Planck luminances in table layers
-      real   y(0:klev,nnuve)          ! intermediaire Planck
-      real   zdblay(0:klev+1,nnuve)   ! gradient en temperature de planck
-      real   ksi
-      real   factp,factz
-
-      nlve = klev  ! (doit correspondre, pour bplck, y et zdblay)
-
-c -----------------------
-c Main loop on grid point
-c -----------------------
-      do ig=1,klon
-
-c Planck function
-c ---------------
-
-       do band=1,nnuve
-         do j=0,nlve
-c B(T,l) = al/(exp(bl/T)-1)
-           y(j,band) = exp(bl(band)/temp(ig,j))-1.
-           bplck(j,band) = al(band)/(y(j,band))
-           zdblay(j,band) = al(band)*bl(band)*exp(bl(band)/temp(ig,j))/
-     .                 ((temp(ig,j)*temp(ig,j))*(y(j,band)*y(j,band)))
-         enddo
-         bplck(nlve+1,band) = 0.0
-         zdblay(nlve+1,band)= 0.0
-       enddo
-
-c interpolating ksi 
-c  and
-c computing psi and deltapsi
-c ---------------------------
-
-c init
-       do j=0,nlve+1
-        do i=0,nlve+1
-         psimap(i,j,ig) = 0.0  ! positif quand nrj de i->j 
-         deltapsimap(i,j,ig) = 0.0
-        enddo
-       enddo
-
-c finding the right matrixes
-       mat0 = 0
-       do mat=1,nbmat-nbztopve
-         if (  (psurfve(mat).ge.psurf(ig))
-     .    .and.(psurfve(mat+nbztopve).lt.psurf(ig))
-     .    .and.(ztopve(mat).lt.ztop(ig))
-     .    .and.(ztopve(mat+1).ge.ztop(ig)) ) then
-              mat0  = mat
-c             print*,'ig=',ig,'  mat0=',mat
-              factp = (psurf(ig)            -psurfve(mat))
-     .               /(psurfve(mat+nbztopve)-psurfve(mat))
-              factz = (ztop(ig)     -ztopve(mat))
-     .               /(ztopve(mat+1)-ztopve(mat))
-         endif
-       enddo
-       if (mat0.eq.0) then
-         write(*,*) 'This is subroutine load_psi'
-         print*,'Probleme pour interpolation au point ig=',ig
-         print*,'psurf = ',psurf(ig),' ztop = ',ztop(ig)
-         stop
-       endif
-
-c------------------
-c !!TEST!! Matrice unique fixee: psurf = 90 bar, ztop = 70
-c      mat0 = 24
-c      print*,'MATRICE UNIQUE: ',mat0,' / ps=',psurfve(mat0),
-c    .                                ' / ztop=',ztopve(mat0)
-c------------------
-
-c interpolation of ksi and computation of psi,deltapsi
-       do band=1,nnuve
-        do j=0,nlve+1
-         do i=0,nlve+1
-          ksi = ksive(i,j,band,mat0)*(1-factz)*(1-factp)
-     .         +ksive(i,j,band,mat0+1)*factz  *(1-factp)
-     .         +ksive(i,j,band,mat0+nbztopve)*(1-factz)*factp
-     .         +ksive(i,j,band,mat0+nbztopve+1)*factz  *factp
-         psimap(i,j,ig) = psimap(i,j,ig) + 
-     .          ksi*(bplck(i,band)-bplck(j,band))
-         deltapsimap(i,j,ig) = deltapsimap(i,j,ig) + 
-     .          ksi*zdblay(i,band)
-         enddo
-        enddo
-       enddo
-
-      enddo !ig
-c -----------------------
-c End loop on grid point 
-c -----------------------
-
-c     print*,"LOAD_PSI OK"
-
-      return
-      end
-
Index: trunk/LMDZ.VENUS/libf/phyvenus/lw_venus_ve.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/lw_venus_ve.F	(revision 927)
+++ trunk/LMDZ.VENUS/libf/phyvenus/lw_venus_ve.F	(revision 953)
@@ -17,6 +17,5 @@
 C
 c     This routine uses the NER matrix
-c     (computed for a given cell and temp profile in radlwsw, 
-c      from the initial matrixes computed in load_psi)
+c     (computed for a given cell and temp profile in radlwsw)
 c     to compute cooling rates and radiative fluxes.
 c
Index: trunk/LMDZ.VENUS/libf/phyvenus/lwi.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/lwi.F	(revision 927)
+++ trunk/LMDZ.VENUS/libf/phyvenus/lwi.F	(revision 953)
@@ -1,8 +1,4 @@
       subroutine lwi(nl,netrad,deltapsi,deltap,temp,coolrate)
 
-c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-c §§§§!!!  VERSION utilisable avec load_psi,  
-c          differente des versions *.1mat  
-c !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
       use dimphy
       implicit none
Index: trunk/LMDZ.VENUS/libf/phyvenus/newstart.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/newstart.F	(revision 927)
+++ trunk/LMDZ.VENUS/libf/phyvenus/newstart.F	(revision 953)
@@ -134,5 +134,5 @@
       integer, dimension(4) :: start,counter
       REAL phisinverse(iip1,jjp1)  ! geopotentiel au sol avant inversion
-      logical topoflag,albedoflag
+      logical topoflag,albedoflag,razvitu
       real    albedo
       
@@ -1040,4 +1040,8 @@
       teta(iip1,:,:) =  teta(1,:,:)
 
+! RESETING U TO 0: may be done through run.def
+       razvitu = . FALSE .
+       CALL getin('razvitu',razvitu)
+
 c calcul des champ de vent; passage en vent covariant
       write (*,*) 'uold ', uold (1,2,1)  ! INFO
@@ -1056,4 +1060,8 @@
      &                   rlonuold,rlatvold,rlonu,rlatv)
       call scal_wind(us,vs,unat,vnat)
+! Reseting u=0
+      if (razvitu) then
+           unat(:,:,:) = 0.
+      endif
       write (*,*) 'unat ', unat (1,2,1)    ! INFO
       do l=1,llm
Index: trunk/LMDZ.VENUS/libf/phyvenus/physiq.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/physiq.F	(revision 927)
+++ trunk/LMDZ.VENUS/libf/phyvenus/physiq.F	(revision 953)
@@ -33,5 +33,5 @@
 c lafin---input-L-variable logique indiquant le dernier passage
 c rjour---input-R-numero du jour de l'experience
-c gmtime--input-R-temps universel dans la journee (0 a RDAY s)
+c gmtime--input-R-fraction de la journee (0 a 1)
 c pdtphys-input-R-pas d'integration pour la physique (seconde)
 c paprs---input-R-pression pour chaque inter-couche (en Pa)
@@ -1087,5 +1087,5 @@
 c====================================================================
       if (ballons.eq.1) then
-         CALL ballon(30,pdtphys,rjourvrai,gmtime,rlatd,rlond,
+         CALL ballon(30,pdtphys,rjourvrai,gmtime*RDAY,rlatd,rlond,
 c    C               t,pplay,u,v,pphi)   ! alt above surface (smoothed for GCM)
      C               t,pplay,u,v,zphi)   ! alt above planet average radius
@@ -1119,5 +1119,5 @@
       ENDDO
 
-      CALL aaam_bud (27,klon,klev,rjourvrai,gmtime,
+      CALL aaam_bud (27,klon,klev,rjourvrai,gmtime*RDAY,
      C               ra,rg,romega,
      C               rlatd,rlond,pphis,
Index: trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F
===================================================================
--- trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F	(revision 927)
+++ trunk/LMDZ.VENUS/libf/phyvenus/radlwsw.F	(revision 953)
@@ -57,5 +57,5 @@
       REAL swnet(klon,klev+1),lwnet(klon,klev+1)
 c
-      INTEGER k, kk, i, j, nb_gr
+      INTEGER k, kk, i, j, band
 c
       REAL   PPB(klev+1)
@@ -71,11 +71,15 @@
 cIM END
       real,save,allocatable :: ksive(:,:,:,:) ! ksi matrixes in Vincent's file
-      real    psimap(0:klev+1,0:klev+1,klon)
-      real    deltapsimap(0:klev+1,0:klev+1,klon)
+      real,save,allocatable :: ztop(:) ! in km
+
       real    psi(0:klev+1,0:klev+1)
       real    deltapsi(0:klev+1,0:klev+1)
       real    latdeg
-      real    pt0(klon,0:klev+1)
-      real,save,allocatable :: ztop(:) ! in km
+      real    pt0(0:klev+1)
+      real    bplck(0:klev+1,nnuve)    ! Planck luminances in table layers
+      real    y(0:klev,nnuve)          ! intermediaire Planck
+      real    zdblay(0:klev+1,nnuve)   ! gradient en temperature de planck
+      integer mat,mat0
+      real    factp,factz,ksi
 
       logical firstcall
@@ -83,6 +87,4 @@
       save    firstcall
       
-c-------------------------------------------
-      nb_gr = klon
 c-------------------------------------------
 c  Initialisations
@@ -116,25 +118,20 @@
 
       endif ! firstcall
-
-      DO i = 1, klon
-          pt0(i,0)  = tsol(i)
-          DO k = 1, klev
-            pt0(i,k) = t(i,k)
-          ENDDO
-          pt0(i,klev+1) = 0.
-      ENDDO !i
-
-      call load_psi(paprs(:,1),ztop,ksive,pt0,psimap,deltapsimap)
+c-------------------------------------------
 
       DO k = 1, klev
-      DO i = 1, klon
+       DO i = 1, klon
          heat(i,k)=0.
          cool(i,k)=0.
+       ENDDO
       ENDDO
-      ENDDO
-c
+
 c+++++++ BOUCLE SUR LA GRILLE +++++++++++++++++++++++++
-      DO 99999 j = 1, nb_gr
- 
+      DO 99999 j = 1, klon
+
+c======================================================================
+c  Initialisations
+c ---------------
+
        DO k = 1, klev
         zheat(k) = 0.0
@@ -154,15 +151,79 @@
          zrmu0 = rmu0(j)
  
-      DO k = 1, klev+1
+       DO k = 1, klev+1
          PPB(k) = paprs(j,k)/1.e5
-      ENDDO
+       ENDDO
+
+       pt0(0)  = tsol(j)
+       DO k = 1, klev
+         pt0(k) = t(j,k)
+       ENDDO
+       pt0(klev+1) = 0.
  
-      DO k = 0,klev+1
-      DO i = 0,klev+1
-        psi(i,k) = psimap(i,k,j) 
-        deltapsi(i,k) = deltapsimap(i,k,j) 
-      ENDDO
-      ENDDO
+       DO k = 0,klev+1
+       DO i = 0,klev+1
+        psi(i,k) = 0.   ! positif quand nrj de i->k
+        deltapsi(i,k) = 0. 
+       ENDDO
+       ENDDO
        
+c======================================================================
+c Getting psi and deltapsi
+c ------------------------
+
+c Planck function
+c ---------------
+      do band=1,nnuve
+        do k=0,klev
+c B(T,l) = al/(exp(bl/T)-1)
+         y(k,band) = exp(bl(band)/pt0(k))-1.
+         bplck(k,band) = al(band)/(y(k,band))
+         zdblay(k,band)= al(band)*bl(band)*exp(bl(band)/pt0(k))/
+     .                  ((pt0(k)*pt0(k))*(y(k,band)*y(k,band)))
+        enddo
+        bplck(klev+1,band) = 0.0
+        zdblay(klev+1,band)= 0.0
+      enddo
+
+c finding the right matrixes
+c --------------------------
+       mat0 = 0
+       do mat=1,nbmat-nbztopve
+         if (  (psurfve(mat).ge.paprs(j,1))
+     .    .and.(psurfve(mat+nbztopve).lt.paprs(j,1))
+     .    .and.(ztopve(mat).lt.ztop(j))
+     .    .and.(ztopve(mat+1).ge.ztop(j)) ) then
+              mat0  = mat
+c             print*,'ig=',j,'  mat0=',mat
+              factp = (paprs(j,1)           -psurfve(mat))
+     .               /(psurfve(mat+nbztopve)-psurfve(mat))
+              factz = (ztop(j)      -ztopve(mat))
+     .               /(ztopve(mat+1)-ztopve(mat))
+              exit
+         endif
+       enddo
+       if (mat0.eq.0) then
+         write(*,*) 'Finding the right matrix in radlwsw'
+         print*,'Probleme pour interpolation au point ig=',j
+         print*,'psurf = ',paprs(j,1),' ztop = ',ztop(j)
+         stop
+       endif
+
+c interpolation of ksi and computation of psi,deltapsi
+c ----------------------------------------------------
+       do band=1,nnuve
+        do k=0,klev+1
+         do i=0,klev+1
+          ksi = ksive(i,k,band,mat0)*(1-factz)*(1-factp)
+     .         +ksive(i,k,band,mat0+1)*factz  *(1-factp)
+     .         +ksive(i,k,band,mat0+nbztopve)*(1-factz)*factp
+     .         +ksive(i,k,band,mat0+nbztopve+1)*factz  *factp
+          psi(i,k) = psi(i,k) + 
+     .               ksi*(bplck(i,band)-bplck(k,band))
+          deltapsi(i,k) = deltapsi(i,k) + ksi*zdblay(i,band)
+         enddo
+        enddo
+       enddo
+
 c======================================================================
 c LW call
