Index: /LMDZ6/trunk/libf/dyn3d/replay3d.f90
===================================================================
--- /LMDZ6/trunk/libf/dyn3d/replay3d.f90	(revision 5457)
+++ /LMDZ6/trunk/libf/dyn3d/replay3d.f90	(revision 5458)
@@ -18,4 +18,6 @@
         grossismx, grossismy, dzoomx, dzoomy,taux,tauy
   USE mod_const_mpi, ONLY: comm_lmdz
+  USE ioipsl, only: getin
+
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   ! FH 2008/05/09 On elimine toutes les clefs physiques dans la dynamique
@@ -26,4 +28,5 @@
   USE dimensions_mod, ONLY: iim, jjm, llm, ndm
   USE paramet_mod_h
+
   IMPLICIT NONE
 
@@ -71,4 +74,6 @@
 
   integer :: ntime=10000,it,klon,klev
+
+  character*20 :: lmax_replay
 
 
@@ -162,8 +167,15 @@
 
 
-     CALL iophys_ini(900.)
 print*,'Rlatu=',rlatu
 klon=2+iim*(jjm-1)
+
+print*,'AVANT getin'
 klev=llm
+CALL getin('lmax_replay',lmax_replay)
+print*,'APRES getin',lmax_replay
+CALL getin(lmax_replay,klev)
+print*,'replay3d lmax_replay klev',lmax_replay,klev
+
+     CALL iophys_ini(900.,klev)
 
 !---------------------------------------------------------------------
Index: /LMDZ6/trunk/libf/phylmd/call_ini_replay.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/call_ini_replay.f90	(revision 5457)
+++ /LMDZ6/trunk/libf/phylmd/call_ini_replay.f90	(revision 5458)
@@ -2,3 +2,3 @@
    stop 'In call_ini_replay : You should run replay_equip.sh before runing replay[13]d'
    return
-   end subroutine call_ini_replay
+   end
Index: /LMDZ6/trunk/libf/phylmd/call_param_replay.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/call_param_replay.f90	(revision 5457)
+++ /LMDZ6/trunk/libf/phylmd/call_param_replay.f90	(revision 5458)
@@ -3,3 +3,3 @@
    stop 'In call_param_replay : You should run replay_equip.sh before runing replay[13]d'
    return
-   end subroutine call_param_replay
+   end
Index: /LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.f90	(revision 5457)
+++ /LMDZ6/trunk/libf/phylmd/dyn1d/replay1d.f90	(revision 5458)
@@ -24,5 +24,5 @@
 CHARACTER (len=10) :: calend
 CHARACTER(len=20) :: calendrier
-
+CHARACTER(len=20) :: lmax_replay
 
 !---------------------------------------------------------------------
@@ -56,4 +56,12 @@
 call getin('calend',calend)
 call getin('day_step',day_step)
+
+print*,'AVANT getin'
+klev=llm
+CALL getin('lmax_replay',lmax_replay)
+print*,'APRES getin',lmax_replay
+CALL getin(lmax_replay,klev)
+print*,'replay1d lmax_replay klev',lmax_replay,klev
+
 calendrier=calend
 if ( calendrier == "earth_360d" ) calendrier="360_day"
@@ -69,5 +77,4 @@
 
 klon=1
-klev=llm
 call iotd_ini('phys.nc',1,1,klev,0.,0.,presnivs,jour0,mois0,an0,0.,86400./day_step,calendrier)
 ! Consistent with ... CALL iophys_ini(600.)
Index: /LMDZ6/trunk/libf/phylmd/lmdz_surf_wind.f90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/lmdz_surf_wind.f90	(revision 5457)
+++ /LMDZ6/trunk/libf/phylmd/lmdz_surf_wind.f90	(revision 5458)
@@ -2,22 +2,22 @@
         CONTAINS 
 
-SUBROUTINE surf_wind(klon,nsrfwnd,zu10m,zv10m,sigmaw,cstar,ustar,wstar,wind10ms,probu)
+SUBROUTINE surf_wind(klon,nsurfwind,zu10m,zv10m,sigmaw,cstar,ustar,wstar,wind10ms,probu)
 
 USE lmdz_surf_wind_ini, ONLY : iflag_surf_wind
 
 IMPLICIT NONE
-INTEGER, INTENT(IN)                :: nsrfwnd, klon
+INTEGER, INTENT(IN)                :: nsurfwind, klon
 REAL, DIMENSION(klon), INTENT(IN)  :: zu10m, zv10m
 REAL, DIMENSION(klon), INTENT(IN)  :: cstar
 REAL, DIMENSION(klon), INTENT(IN)  :: sigmaw
 REAL, DIMENSION(klon), INTENT(IN)  :: ustar, wstar
-REAL, DIMENSION(klon,nsrfwnd), INTENT(OUT)         :: wind10ms, probu
+REAL, DIMENSION(klon,nsurfwind), INTENT(OUT)         :: wind10ms, probu
 
 
-REAL, DIMENSION(klon,nsrfwnd)         :: sigma_th, sigma_wk
-REAL, DIMENSION(klon,nsrfwnd)         :: xp, yp, zz
-REAL, DIMENSION(klon,nsrfwnd)         :: vwx, vwy, vw
-REAL, DIMENSION(klon,nsrfwnd)         :: vtx, vty
-REAL, DIMENSION(klon,nsrfwnd)         :: windx, windy, wind
+REAL, DIMENSION(klon,nsurfwind)         :: sigma_th, sigma_wk
+REAL, DIMENSION(klon,nsurfwind)         :: xp, yp, zz
+REAL, DIMENSION(klon,nsurfwind)         :: vwx, vwy, vw
+REAL, DIMENSION(klon,nsurfwind)         :: vtx, vty
+REAL, DIMENSION(klon,nsurfwind)         :: windx, windy, wind
 REAL, DIMENSION(klon)                 :: ubwk, vbwk      ! ubwk et vbwk sont les vitesses moyennes dans les poches
 REAL, DIMENSION(klon)                 :: weilambda, U10mMOD
@@ -30,5 +30,5 @@
 REAL    :: ktwk, ktth, kzth
 
-print*,'LLLLLLLLLLLLLLLLLLLLL nsrfwnd=',nsrfwnd
+print*,'LLLLLLLLLLLLLLLLLLLLL nsurfwind=',nsurfwind
 pi=2.*acos(0.)
 ray=7000.
@@ -37,5 +37,5 @@
 kzth=1.
 kref=3
-nwb=nsrfwnd
+nwb=nsurfwind
 
 ubwk(klon) = zu10m(klon)
@@ -53,6 +53,6 @@
 IF (iflag_surf_wind == 0) THEN
     !U10mMOD=sqrt(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
-    IF (nsrfwnd /= 1 ) THEN
-            STOP 'Si iflag_surf_wind=0, nsrfwnd=1'
+    IF (nsurfwind /= 1 ) THEN
+            STOP 'Si iflag_surf_wind=0, nsurfwind=1'
     ENDIF
     DO i=1,klon
@@ -66,5 +66,5 @@
 
     DO i=1, klon
-        DO nmc=1, nsrfwnd
+        DO nmc=1, nsurfwind
              ! Utilisation de la distribution de weibull
              !U10mMOD=sqrt(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
@@ -90,5 +90,5 @@
 
     DO i=1, klon
-        DO nmc=1, nsrfwnd
+        DO nmc=1, nsurfwind
             ! Utilisation de la distribution du vent a l interieur et a l exterieur des poches 
             call Random_number(zz)     ! tirage uniforme entre 0 et 1.
@@ -122,5 +122,5 @@
                   wind(i,nmc) = sqrt(windx(i,nmc)**2 + windy(i,nmc)**2)
                   wind10ms(i,nmc) = wind(i,nmc)
-                  probu(i,nmc) = wind(i,nmc)/nsrfwnd
+                  probu(i,nmc) = wind(i,nmc)/nsurfwind
 
             ELSE
@@ -143,5 +143,5 @@
                   wind(i,nmc) = sqrt(windx(i,nmc)**2 + windy(i,nmc)**2)
                   wind10ms(i,nmc) = wind(i,nmc)
-                  probu(i,nmc) = wind(i,nmc)/nsrfwnd
+                  probu(i,nmc) = wind(i,nmc)/nsurfwind
                   ! print*, 'wind10ms', wind10ms(i,nmc)         
             ENDIF
Index: /LMDZ6/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5457)
+++ /LMDZ6/trunk/libf/phylmd/physiq_mod.F90	(revision 5458)
@@ -1268,7 +1268,7 @@
     ! Subgrid scale wind :
     ! Need to be allocatable/save because the number of bin is not known (provided by surf_wind_ini)
-    integer, save :: nsrfwnd=1
+    integer, save :: nsurfwind=1
     real, dimension(:,:), allocatable, save :: surf_wind_value, surf_wind_proba ! module and probability of sugrdi wind wind sample
-    !$OMP THREADPRIVATE(nsrfwnd,surf_wind_value, surf_wind_proba)
+    !$OMP THREADPRIVATE(nsurfwind,surf_wind_value, surf_wind_proba)
     
 
@@ -1831,6 +1831,6 @@
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
        CALL surf_wind_ini(klon,lunout)
-       CALL getin_p('nsrfwnd',nsrfwnd)
-       allocate(surf_wind_value(klon,nsrfwnd),surf_wind_proba(klon,nsrfwnd))
+       CALL getin_p('nsurfwind',nsurfwind)
+       allocate(surf_wind_value(klon,nsurfwind),surf_wind_proba(klon,nsurfwind))
     
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -3819,5 +3819,5 @@
     !===================================================================
     ! Computation of subrgid scale near-surface wind distribution
-    call surf_wind(klon,nsrfwnd,u10m,v10m,wake_s,wake_Cstar,ustar,wstar,surf_wind_value,surf_wind_proba)
+    call surf_wind(klon,nsurfwind,u10m,v10m,wake_s,wake_Cstar,ustar,wstar,surf_wind_value,surf_wind_proba)
 
     !===================================================================
