Index: /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/climb_wind_mod.f90
===================================================================
--- /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/climb_wind_mod.f90	(revision 5878)
+++ /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/climb_wind_mod.f90	(revision 5879)
@@ -27,5 +27,5 @@
 
   
-  PUBLIC :: climb_wind_down, climb_wind_up
+  PUBLIC :: climb_wind_down, climb_wind_up, climb_wind_init
 
 CONTAINS
@@ -38,34 +38,50 @@
     CHARACTER(len = 20) :: modname = 'climb_wind_init'    
 
-!****************************************************************************************
-! Allocation of global module variables
-!
-!****************************************************************************************
-
-    ALLOCATE(alf1(klon), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf1',1)
-
-    ALLOCATE(alf2(klon), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf2',1)
-
-    ALLOCATE(Kcoefm(klon,klev), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Kcoefm',1)
-
-    ALLOCATE(Ccoef_U(klon,klev), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Ccoef_U',1)
-
-    ALLOCATE(Dcoef_U(klon,klev), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_U',1)
-
-    ALLOCATE(Ccoef_V(klon,klev), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Ccoef_V',1)
-
-    ALLOCATE(Dcoef_V(klon,klev), stat=ierr)
-    IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_V',1)
-
-    ALLOCATE(Acoef_U(klon), Bcoef_U(klon), Acoef_V(klon), Bcoef_V(klon), STAT=ierr)
-    IF ( ierr /= 0 )  PRINT*,' pb in allloc Acoef_U and Bcoef_U, ierr=', ierr
-
-    firstcall=.FALSE.
+
+!****************************************************************************************
+! Initialize module
+    
+    IF (firstcall) THEN
+
+      !****************************************************************************************
+      ! Allocation of global module variables
+      !
+      !****************************************************************************************
+  
+      ALLOCATE(alf1(klon), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf1',1)
+      alf1(:) = 0.
+  
+      ALLOCATE(alf2(klon), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate alf2',1)
+      alf2(:) = 0.
+  
+      ALLOCATE(Kcoefm(klon,klev), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Kcoefm',1)
+      Kcoefm(:,:) = 0.
+  
+      ALLOCATE(Ccoef_U(klon,klev), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocate Ccoef_U',1)
+      Ccoef_U(:,:) = 0.
+  
+      ALLOCATE(Dcoef_U(klon,klev), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_U',1)
+      Dcoef_U(:,:) = 0.
+  
+      ALLOCATE(Ccoef_V(klon,klev), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Ccoef_V',1)
+      Ccoef_V(:,:) = 0.
+  
+      ALLOCATE(Dcoef_V(klon,klev), stat=ierr)
+      IF (ierr /= 0) CALL abort_physic(modname,'Pb in allocation Dcoef_V',1)
+      Dcoef_V(:,:) = 0.
+  
+      ALLOCATE(Acoef_U(klon), Bcoef_U(klon), Acoef_V(klon), Bcoef_V(klon), STAT=ierr)
+      IF ( ierr /= 0 )  PRINT*,' pb in allloc Acoef_U and Bcoef_U, ierr=', ierr
+      Acoef_U(:) = 0. ; Bcoef_U(:) = 0. ; Acoef_V(:) = 0. ; Bcoef_V(:) = 0. ;
+  
+      firstcall=.FALSE.
+    
+    ENDIF
 
   END SUBROUTINE climb_wind_init
@@ -79,4 +95,6 @@
 !!!
        Acoef_U_out, Acoef_V_out, Bcoef_U_out, Bcoef_V_out)
+!$gpum horizontal knon
+
 !
 ! This routine calculates for the wind components u and v,
@@ -131,7 +149,4 @@
     INTEGER                                  :: k, i, j
 
-!****************************************************************************************
-! Initialize module
-    IF (firstcall) CALL climb_wind_init
 
 !****************************************************************************************
@@ -153,12 +168,12 @@
 
 ! - Calculate the coefficients C and D, component "u"
-    CALL calc_coef(knon, yKcoefm(:,:), delp(:,:), &
-         u_old(:,:), yalf1(:), yalf2(:),  &
-         yCcoef_U(:,:), yDcoef_U(:,:), yAcoef_U(:), yBcoef_U(:))
+    CALL calc_coef(knon, yKcoefm, delp, &
+         u_old, yalf1, yalf2,  &
+         yCcoef_U, yDcoef_U, yAcoef_U, yBcoef_U)
 
 ! - Calculate the coefficients C and D, component "v"
-    CALL calc_coef(knon, yKcoefm(:,:), delp(:,:), &
-         v_old(:,:), yalf1(:), yalf2(:),  &
-         yCcoef_V(:,:), yDcoef_V(:,:), yAcoef_V(:), yBcoef_V(:))
+    CALL calc_coef(knon, yKcoefm, delp, &
+         v_old, yalf1, yalf2,  &
+         yCcoef_V, yDcoef_V, yAcoef_V, yBcoef_V)
 
 !****************************************************************************************
@@ -222,4 +237,6 @@
 !
   SUBROUTINE calc_coef(knon, Kcoef, delp, X, alfa1, alfa2, Ccoef, Dcoef, Acoef, Bcoef)
+!$gpum horizontal knon
+
 !
 ! Find the coefficients C and D in fonction of alfa, K and delp
@@ -289,4 +306,6 @@
 !!!
        flx_u_new, flx_v_new, d_u_new, d_v_new)
+!$gpum horizontal knon
+
 !
 ! Diffuse the wind components from the surface layer and up to the top layer. 
Index: /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/pbl_surface_mod.F90
===================================================================
--- /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/pbl_surface_mod.F90	(revision 5878)
+++ /LMDZ6/branches/PBLSURF_GPUPORT/libf/phylmd/pbl_surface_mod.F90	(revision 5879)
@@ -110,4 +110,5 @@
     USE cdrag_mod, ONLY : cdrag_init
     USE climb_hq_mod, ONLY : climb_hq_init
+    USE climb_wind_mod, ONLY : climb_wind_init
     IMPLICIT NONE
  
@@ -265,4 +266,5 @@
     CALL cdrag_init
     CALL climb_hq_init
+    CALL climb_wind_init
 
   END SUBROUTINE pbl_surface_init
