Index: codes/icosagcm/devel/src/dissip/guided_mod.f90
===================================================================
--- codes/icosagcm/devel/src/dissip/guided_mod.f90	(revision 868)
+++ codes/icosagcm/devel/src/dissip/guided_mod.f90	(revision 874)
@@ -2,4 +2,5 @@
 
   CHARACTER(LEN=255),SAVE :: guided_type
+  CHARACTER(LEN=255),SAVE :: guided_nudging_field
 !$OMP THREADPRIVATE(guided_type)
 
Index: codes/icosagcm/devel/src/dissip/nudging_mod.f90
===================================================================
--- codes/icosagcm/devel/src/dissip/nudging_mod.f90	(revision 868)
+++ codes/icosagcm/devel/src/dissip/nudging_mod.f90	(revision 874)
@@ -17,4 +17,6 @@
   TYPE(t_field),POINTER :: f_relax_coef_e(:), f_target_ue(:), &
        f_relax_coef_i(:), f_target_theta_rhodz(:)
+  CHARACTER(LEN=255),SAVE :: guided_nudging_field
+  INTEGER,SAVE :: nudging_time
 
   PUBLIC :: init_guided, guided
@@ -39,18 +41,28 @@
     CALL getin('nudging_radius', nudging_radius)
     nudging_radius = nudging_radius / scale_factor
-!    time=0.
-!    CALL getin('nudging_time', time)
+
+    nudging_time=0.
+    CALL getin('nudging_time', nudging_time)
 
     ! we should check that radius>0
-
-    !SELECT CASE(TRIM(nudg_name))
-    !    CASE ('f_u')
-        CALL allocate_field(f_relax_coef_e, field_u, type_real, name='nudging_coef_e')
-        CALL allocate_field(f_target_ue, field_u, type_real, llm, name='nudging_target_e')
-    !    CASE ('f_theta_rhodz')
-        CALL allocate_field(f_relax_coef_i, field_t, type_real, name='nudging_coef_i')
-        CALL allocate_field(f_target_theta_rhodz, field_t, type_real, llm,nqdyn, name='nudging_target_theta')
-    !    CASE DEFAULT
-    !END SELECT
+    CALL getin("guided_nudging_field",guided_nudging_field)
+
+    SELECT CASE(TRIM(guided_nudging_field))
+        CASE ('wind')
+            CALL allocate_field(f_relax_coef_e, field_u, type_real, name='nudging_coef_e')
+            CALL allocate_field(f_target_ue, field_u, type_real, llm, name='nudging_target_e')
+        CASE ('temperature')
+            CALL allocate_field(f_relax_coef_i, field_t, type_real, name='nudging_coef_i')
+            CALL allocate_field(f_target_theta_rhodz, field_t, type_real, llm,nqdyn, name='nudging_target_theta')
+        CASE ('wind_temperature')
+            CALL allocate_field(f_relax_coef_e, field_u, type_real, name='nudging_coef_e')
+            CALL allocate_field(f_target_ue, field_u, type_real, llm, name='nudging_target_e')
+            CALL allocate_field(f_relax_coef_i, field_t, type_real, name='nudging_coef_i')
+            CALL allocate_field(f_target_theta_rhodz, field_t, type_real, llm,nqdyn, name='nudging_target_theta')
+        CASE DEFAULT
+                 PRINT*,"Bad selector for varaible init_guided_nudging>",TRIM(guided_nudging_field)
+                 PRINT*," option are <none>, <wind>, <temperature>,<wind_temperature>"
+                 STOP
+    END SELECT
 
     ! compute relax_coef and target_ue
@@ -94,4 +106,6 @@
     CALL dist_lonlat(lon, lat, center_lon, center_lat, dist) 
     c = tanh((1.-radius*dist/nudging_radius)*20.) ! 1 inside circle, -1 outside
+    IF (c>0.99) c=1
+    IF (c<-0.99) c=-1
     relax_coef = .5*(1.+c) ! rescale to [0,1] range ; ! 1 inside circle, 0 outside
   END FUNCTION relax_coef
@@ -128,4 +142,10 @@
   
   SUBROUTINE guided(tt, f_ps, f_theta_rhodz, f_u, f_q)
+    USE xios_mod
+    USE theta2theta_rhodz_mod
+    USE wind_mod
+    USE transfert_mod
+    USE time_mod
+    USE pression_mod
     REAL(rstd), INTENT(IN):: tt
     TYPE(t_field),POINTER :: f_ps(:)
@@ -133,8 +153,35 @@
     TYPE(t_field),POINTER :: f_theta_rhodz(:)
     TYPE(t_field),POINTER :: f_u(:)  
-    TYPE(t_field),POINTER :: f_q(:)  
+    TYPE(t_field),POINTER :: f_q(:) 
+    TYPE(t_field),POINTER :: f_T_guided(:),  f_ulon_guided(:), f_ulat_guided(:),f_pressure_mid(:) 
     REAL(rstd), POINTER :: target_ue(:,:), ue(:,:), coef_e(:)
     REAL(rstd), POINTER :: target_theta_rhodz(:,:,:), theta_rhodz(:,:,:), coef_i(:) 
     INTEGER :: ind
+
+    IF (MOD(INT(tt),nudging_time)==dt) THEN
+   
+      CALL allocate_field(f_T_guided, field_t, type_real, llm, name='nudging_T')
+      CALL allocate_field(f_ulon_guided, field_t, type_real, llm, name='nudging_ulon')
+      CALL allocate_field(f_ulat_guided, field_t, type_real, llm, name='nudging_ulat')
+
+      CALL xios_read_field("T_guided_read",f_T_guided)
+      CALL transfert_request(f_T_guided,req_i0)
+      CALL temperature2theta_rhodz(f_ps,f_T_guided,f_target_theta_rhodz)
+      CALL xios_read_field("ulon_guided_read",f_ulon_guided)
+      CALL xios_read_field("ulat_guided_read",f_ulat_guided)
+      CALL transfert_request(f_ulon_guided,req_i0)
+      CALL transfert_request(f_ulat_guided,req_i0)
+      CALL transfert_request(f_ulon_guided,req_i1)
+      CALL transfert_request(f_ulat_guided,req_i1)
+      CALL xios_write_field("ulat_guided_out",f_ulat_guided)
+      CALL xios_write_field("ulon_guided_out",f_ulon_guided)
+      CALL ulonlat2un(f_ulon_guided, f_ulat_guided,f_target_ue)
+
+      CALL deallocate_field(f_T_guided)
+      CALL deallocate_field(f_ulon_guided)
+      CALL deallocate_field(f_ulat_guided)
+    
+    ENDIF
+
 
     DO ind = 1 , ndomain
Index: codes/icosagcm/devel/src/output/xios_mod.F90
===================================================================
--- codes/icosagcm/devel/src/output/xios_mod.F90	(revision 868)
+++ codes/icosagcm/devel/src/output/xios_mod.F90	(revision 874)
@@ -48,4 +48,5 @@
  USE time_mod
  USE metric, ONLY : vup,vdown, cell_glo
+ USE disvert_mod, ONLY : presnivs
  IMPLICIT NONE
   TYPE(xios_context) :: ctx_hdl
@@ -70,4 +71,5 @@
    CALL xios_set_axis_attr("lev",n_glo=llm ,value=lev_value) ;
    CALL xios_set_axis_attr("levp1",n_glo=llm+1 ,value=lev_valuep1) ;
+   CALL xios_set_axis_attr("presnivs_mb",n_glo=llm, value=presnivs/100., unit="mb") ; 
    CALL xios_set_axis_attr("nq",n_glo=nqtot, value=nq_value) ;
    
