Index: trunk/LMDZ.GENERIC/changelog.txt
===================================================================
--- trunk/LMDZ.GENERIC/changelog.txt	(revision 3396)
+++ trunk/LMDZ.GENERIC/changelog.txt	(revision 3397)
@@ -1966,2 +1966,6 @@
 Just to organize datagcm
 Now in datagcm/stellar_spectra/photochem_stellar_spectra/
+
+== 17/07/2024 == SB
+Fix/clarification of the usage of tice (sea ice surface temperature) vs.
+tsea_ice (temperature of the top layer (ice or snow)).
Index: trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90	(revision 3396)
+++ trunk/LMDZ.GENERIC/libf/phystd/ocean_slab_mod.F90	(revision 3397)
@@ -459,6 +459,4 @@
 !    CALL calcul_flux_wind(knon, dtime, &
 !         u0, v0, u1, v1, gustiness, cdragm, &
-!         AcoefU, AcoefV, BcoefU, BcoefV, &
-!         p1lay, temp_air, &
 !         flux_u1, flux_v1)
 
@@ -1055,4 +1053,5 @@
     WHERE ((zmasq==0).and. &
            ((fsic.LT.ice_frac_min).OR.(seaice.LT.h_ice_min)))
+!!    WHERE ((fsic.LT.ice_frac_min).OR.(seaice.LT.h_ice_min))
         tslab(:,1)=tslab(:,1)-fsic*seaice*ice_lat*cyang
         tice=t_melt
@@ -1106,11 +1105,13 @@
 
 ! Set the output variables
+    tslab_loc(:,:) = 0.
+    tice_loc(:)=0.
+    dt_hdiff_loc(:,:)=0.
+    dt_ekman_loc(:,:)=0.
+    dt_gm_loc(:,:)=0.
     tslab_loc(:,:) = tslab(:,:)
     tice_loc(:)=tice(:)
     seaice_loc(:) = seaice(:)
     flux_g_loc(:) = slab_bilg(:)
-    dt_hdiff_loc(:,:)=0.
-    dt_ekman_loc(:,:)=0.
-    dt_gm_loc(:,:)=0.
 
 !!      dt_hdiff_loc(:,i) = dt_hdiff(:,i)*slabh(i)*1000.*4228. !Convert en W/m2
Index: trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90	(revision 3396)
+++ trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90	(revision 3397)
@@ -9,5 +9,5 @@
                      day_ini,time,tsurf,tsoil,emis,albedo, &
                      q2,qsurf,cloudfrac,totcloudfrac,hice, &
-                     rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
+                     rnat,pctsrf_sic,tslab,tsea_ice,tice,sea_ice)
 
 ! to use  'getin_p'
@@ -58,5 +58,5 @@
   real,intent(out) :: tsea_ice(ngrid),sea_ice(ngrid)
   real,intent(out) :: rnat(ngrid)
-!  real,intent(out) :: tice(ngrid)
+  real,intent(out) :: tice(ngrid)
 
 !======================================================================
@@ -363,19 +363,19 @@
   tsea_ice(1:ngrid)=273.15-1.8
 endif ! of if (startphy_file)
-write(*,*) "phyetat0: Oceanic ice temperature <tsea_ice> range:", &
+write(*,*) "phyetat0: Oceanic ice/snow temperature <tsea_ice> range:", &
              minval(tsea_ice), maxval(tsea_ice)
 
-!if (startphy_file) then
+if (startphy_file) then
   ! Oceanic ice temperature
-!  call get_field("tice",tice,found,indextime)
-!  if (.not.found) then
-!    write(*,*) "phyetat0: Failed loading <tice>"
-!    tice(1:ngrid)=273.15-1.8
-!  endif
-!else
-!  tice(1:ngrid)=273.15-1.8
-!endif ! of if (startphy_file)
-!write(*,*) "phyetat0: Oceanic ice temperature <tice> range:", &
-!             minval(tice), maxval(tice)
+  call get_field("tice",tice,found,indextime)
+  if (.not.found) then
+    write(*,*) "phyetat0: Failed loading <tice>"
+    tice(1:ngrid)=273.15-1.8
+  endif
+else
+  tice(1:ngrid)=273.15-1.8
+endif ! of if (startphy_file)
+write(*,*) "phyetat0: Oceanic ice surface temperature <tice> range:", &
+             minval(tice), maxval(tice)
 
 if (startphy_file) then
Index: trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90	(revision 3396)
+++ trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90	(revision 3397)
@@ -136,5 +136,5 @@
                     phystep,time,tsurf,tsoil,emis,albedo,q2,qsurf, &
                     cloudfrac,totcloudfrac,hice, &
-                    rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
+                    rnat,pctsrf_sic,tslab,tsea_ice,tice,sea_ice)
   ! write time-dependent variable to restart file
   use iostart, only : open_restartphy, close_restartphy, & 
@@ -171,5 +171,5 @@
   real,intent(in) :: tsea_ice(ngrid)
   real,intent(in) :: sea_ice(ngrid)
-!  real,intent(in) :: tice(ngrid)
+  real,intent(in) :: tice(ngrid)
 
   integer :: iq
@@ -208,5 +208,5 @@
    call put_field("tslab","Temperature slab ocean",tslab)
    call put_field("tsea_ice","Temperature of top layer (seaice or snow)",tsea_ice)
-!   call put_field("tice","Temperature of seaice if snow on top",tice)
+   call put_field("tice","Temperature of seaice",tice)
    call put_field("sea_ice","Sea ice mass",sea_ice)
  endif!(ok_slab_ocean)
Index: trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90	(revision 3396)
+++ trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90	(revision 3397)
@@ -92,5 +92,5 @@
       real,dimension(:,:),allocatable,save :: tslab        ! Slab_ocean temperature (K)
       real,dimension(:),allocatable,save ::  tsea_ice      ! Temperature of the top layer (K), either snow or ice
-!      real,dimension(:),allocatable,save :: tice           ! Sea ice temperature (K) if there is snow on top of it
+!      real,dimension(:),allocatable,save :: tice           ! Sea ice temperature (K)
       real,dimension(:),allocatable,save :: sea_ice
       real,dimension(:),allocatable,save :: zmasq
Index: trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3396)
+++ trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3397)
@@ -395,4 +395,7 @@
 ! local variables for DIAGNOSTICS : (diagfi & stat)
 ! -------------------------------------------------
+
+      real tice(ngrid)                                   ! Sea ice temperature
+
       real ps(ngrid)                                     ! Surface Pressure.
       real zt(ngrid,nlayer)                              ! Atmospheric Temperature.
@@ -596,5 +599,5 @@
                        day_ini,time_phys,tsurf,tsoil,emis,albedo,     &
                        q2,qsurf,cloudfrac,totcloudfrac,hice,          &
-                       rnat,pctsrf_sic,tslab, tsea_ice,sea_ice)
+                       rnat,pctsrf_sic,tslab,tsea_ice,tice,sea_ice)
 
 #else
@@ -605,5 +608,5 @@
 #ifndef MESOSCALE
          if (.not.startphy_file) then
-           ! additionnal "academic" initialization of physics
+           ! additional "academic" initialization of physics
            if (is_master) write(*,*) "Physiq: initializing tsurf(:) to pt(:,1) !!"
            tsurf(:)=pt(:,1)
@@ -664,9 +667,9 @@
            enddo
 
-           call ocean_slab_init(ptimestep, pctsrf_sic, tslab, tsea_ice, sea_ice, zmasq)
+           call ocean_slab_init(ptimestep, pctsrf_sic, tslab, tice, sea_ice, zmasq)
 
 !!           CALL init_masquv(ngrid,zmasq)
            ! ensure that "slab" variables match "physiq" ones
-           call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
+           call ocean_slab_get_vars(ngrid, tslab, tice, sea_ice, flux_g, &
                       dt_hdiff, dt_ekman, dt_gm)
            
@@ -1989,8 +1992,11 @@
                       tsea_ice, -zdqsdif(:,igcm_h2o_vap), taux, tauy, zmasq)
 
-            call ocean_slab_frac(pctsrf_sic, zmasq)
-
-            call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
+            call ocean_slab_frac(pctsrf_sic, zmasq) 
+             
+            call ocean_slab_get_vars(ngrid, tslab, tice, sea_ice, flux_g, &
                       dt_hdiff, dt_ekman, dt_gm)
+
+!!!            call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
+!!!                      dt_hdiff, dt_ekman, dt_gm)
 		      
 !! sea_ice defines the sea ice thickness in kg/m2
@@ -2389,5 +2395,5 @@
             
             ! fetch "ocean variables" to ensure they are stored
-            call ocean_slab_get_vars(ngrid, tslab, tsea_ice, sea_ice, flux_g, &
+            call ocean_slab_get_vars(ngrid, tslab, tice, sea_ice, flux_g, &
                                      dt_hdiff, dt_ekman, dt_gm)
 
@@ -2396,5 +2402,5 @@
                           tsurf,tsoil,emis,albedo,q2,qsurf_hist,  &
                           cloudfrac,totcloudfrac,hice,            &
-                          rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
+                          rnat,pctsrf_sic,tslab,tsea_ice,tice,sea_ice)
          endif
 #endif
@@ -2485,5 +2491,5 @@
             call wstats(ngrid,"pctsrf_sic","pct ice/sea","",2,pctsrf_sic)
             call wstats(ngrid,"tsea_ice","top layer temp, snow/ice","K",2,tsea_ice)
-!            call wstats(ngrid,"tice","ice temp if snow on top","K",2,tice)
+!            call wstats(ngrid,"tice","sea ice temperature","K",2,tice)
             call wstats(ngrid,"sea_ice","sea ice","kg/m2",2,sea_ice)
             call wstats(ngrid,"rnat","nature of the surface","",2,rnat)
@@ -2528,5 +2534,5 @@
          call writediagfi(ngrid,"pctsrf_sic","pct ice/sea","",2,pctsrf_sic)
          call writediagfi(ngrid,"tsea_ice","top layer temp, snow/ice","K",2,tsea_ice)
-!         call writediagfi(ngrid,"tice","ice temp if snow on top","K",2,tice)
+!         call writediagfi(ngrid,"tice","sea ice temperature","K",2,tice)
          call writediagfi(ngrid,"sea_ice","sea ice","kg/m2",2,sea_ice)
          call writediagfi(ngrid,"tslab1","tslab1","K",2,tslab(:,1))
