Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis.F
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis.F	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis.F	(revision 4368)
@@ -29,5 +29,5 @@
 c    Auteur :  P. Le Van, F. Hourdin 
 c   .........
-      USE infotrac, ONLY: nqtot, niadv, tname
+      USE infotrac, ONLY: nqtot, tracers
       USE control_mod, ONLY: planet_type, nsplit_phys
 #ifdef CPP_PHYS
@@ -135,5 +135,5 @@
 c    -----------------
 
-      INTEGER i,j,l,ig0,ig,iq,iiq
+      INTEGER i,j,l,ig0,ig,iq,itr
       REAL zpsrf(ngridmx)
       REAL zplev(ngridmx,llm+1),zplay(ngridmx,llm)
@@ -281,16 +281,18 @@
 c   ---------------
 c
+      itr=0
       DO iq=1,nqtot
-          iiq=niadv(iq) 
+         IF(.NOT.tracers(iq)%isAdvected) CYCLE
+         itr = itr + 1
          DO l=1,llm
-            zqfi(1,l,iq) = pq(1,1,l,iiq)
-            ig0          = 2
+            zqfi(1,l,itr) = pq(1,1,l,iq)
+            ig0           = 2
             DO j=2,jjm
                DO i = 1, iim
-                  zqfi(ig0,l,iq)  = pq(i,j,l,iiq)
+                  zqfi(ig0,l,itr) = pq(i,j,l,iq)
                   ig0             = ig0 + 1
                ENDDO
             ENDDO
-            zqfi(ig0,l,iq) = pq(1,jjp1,l,iiq)
+            zqfi(ig0,l,itr) = pq(1,jjp1,l,iq)
          ENDDO
       ENDDO
@@ -481,5 +483,6 @@
          lafin_split=lafin.and.isplit==nsplit_phys
 
-        CALL call_physiq(ngridmx,llm,nqtot,tname,
+!      if (planet_type=="earth") then
+        CALL call_physiq(ngridmx,llm,nqtot,tracers(:)%name,
      &                   debut_split,lafin_split,
      &                   jD_cur,jH_cur_split,zdt_split,
@@ -490,30 +493,4 @@
      &                   flxwfi,pducov,
      &                   zdufi,zdvfi,zdtfi,zdqfi,zdpsrf)
-                             
-!      if (planet_type=="earth") then
-!
-!         CALL physiq (ngridmx,
-!     .             llm,
-!     .             debut_split,
-!     .             lafin_split,
-!     .             jD_cur,
-!     .             jH_cur_split,
-!     .             zdt_split,
-!     .             zplev,
-!     .             zplay,
-!     .             zphi,
-!     .             zphis,
-!     .             presnivs,
-!     .             zufi,
-!     .             zvfi, zrfi,
-!     .             ztfi,
-!     .             zqfi,
-!     .             flxwfi,
-!     .             zdufi,
-!     .             zdvfi,
-!     .             zdtfi,
-!     .             zdqfi,
-!     .             zdpsrf,
-!     .             pducov)
 !
 !      else if ( planet_type=="generic" ) then
@@ -522,5 +499,5 @@
 !     .             llm,            !! nlayer
 !     .             nqtot,          !! nq
-!     .             tname,          !! tracer names from dynamical core (given in infotrac)
+!     .             tracers(:)%name,!! tracer names from dynamical core (given in infotrac)
 !     .             debut_split,    !! firstcall 
 !     .             lafin_split,    !! lastcall
@@ -622,17 +599,19 @@
       pdqfi(:,:,:,:)=0.
 C
+      itr = 0
       DO iq=1,nqtot
-         iiq=niadv(iq)
+         IF(.NOT.tracers(iq)%isAdvected) CYCLE
+         itr = itr + 1
          DO l=1,llm
             DO i=1,iip1
-               pdqfi(i,1,l,iiq)    = zdqfi(1,l,iq)
-               pdqfi(i,jjp1,l,iiq) = zdqfi(ngridmx,l,iq)
+               pdqfi(i,1,l,iq)    = zdqfi(1,l,itr)
+               pdqfi(i,jjp1,l,iq) = zdqfi(ngridmx,l,itr)
             ENDDO
             DO j=2,jjm
                ig0=1+(j-2)*iim
                DO i=1,iim
-                  pdqfi(i,j,l,iiq) = zdqfi(ig0+i,l,iq)
+                  pdqfi(i,j,l,iq) = zdqfi(ig0+i,l,itr)
                ENDDO
-               pdqfi(iip1,j,l,iiq) = pdqfi(1,j,l,iq)
+               pdqfi(iip1,j,l,iq) = pdqfi(1,j,l,itr)
             ENDDO
          ENDDO
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis_loc.F
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis_loc.F	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/calfis_loc.F	(revision 4368)
@@ -45,5 +45,5 @@
       USE Times
 #endif
-      USE infotrac, ONLY: nqtot, niadv, tname
+      USE infotrac, ONLY: nqtot, tracers
       USE control_mod, ONLY: planet_type, nsplit_phys
 #ifdef CPP_PHYS
@@ -154,5 +154,5 @@
 c    -----------------
 
-      INTEGER i,j,l,ig0,ig,iq,iiq
+      INTEGER i,j,l,ig0,ig,iq,itr
       REAL,ALLOCATABLE,SAVE :: zpsrf(:)
       REAL,ALLOCATABLE,SAVE :: zplev(:,:),zplay(:,:)
@@ -366,6 +366,8 @@
 c
 
+      itr = 0
       DO iq=1,nqtot
-         iiq=niadv(iq)
+         IF(.NOT.tracers(iq)%isAdvected) CYCLE
+         itr = itr + 1
 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
          DO l=1,llm
@@ -375,5 +377,5 @@
              i=index_i(ig0)
              j=index_j(ig0)
-             zqfi(ig0,l,iq)  = pq(i,j,l,iiq)
+             zqfi(ig0,l,itr)  = pq(i,j,l,iq)
            enddo
          ENDDO
@@ -731,5 +733,5 @@
          lafin_split=lafin.and.isplit==nsplit_phys
 
-        CALL call_physiq(klon,llm,nqtot,tname,
+        CALL call_physiq(klon,llm,nqtot,tracers(:)%name,
      &                   debut_split,lafin_split,
      &                   jD_cur,jH_cur_split,zdt_split,
@@ -1069,6 +1071,8 @@
 C
 !cdir NODEP
+      itr = 0
       DO iq=1,nqtot
-         iiq=niadv(iq)
+         IF(.NOT.tracers(iq)%isAdvected) CYCLE
+         itr = itr + 1
 c$OMP DO SCHEDULE(STATIC,OMP_CHUNK)
          DO l=1,llm
@@ -1079,11 +1083,11 @@
               i=index_i(ig0)
               j=index_j(ig0)
-              pdqfi(i,j,l,iiq) = zdqfi(ig0,l,iq)
-              if (i==1) pdqfi(iip1,j,l,iiq) = zdqfi(ig0,l,iq)
+              pdqfi(i,j,l,iq) = zdqfi(ig0,l,itr)
+              if (i==1) pdqfi(iip1,j,l,iq) = zdqfi(ig0,l,itr)
             ENDDO
             
             IF (is_north_pole_dyn) then
               DO i=1,iip1
-                pdqfi(i,1,l,iiq)    = zdqfi(1,l,iq)
+                pdqfi(i,1,l,iq)    = zdqfi(1,l,itr)
               ENDDO
             ENDIF
@@ -1091,5 +1095,5 @@
             IF (is_south_pole_dyn) then
               DO i=1,iip1
-                pdqfi(i,jjp1,l,iiq) = zdqfi(klon,l,iq)
+                pdqfi(i,jjp1,l,iq) = zdqfi(klon,l,itr)
               ENDDO
             ENDIF
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/inigeomphy_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/inigeomphy_mod.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/inigeomphy_mod.F90	(revision 4368)
@@ -25,5 +25,5 @@
   USE nrtype, ONLY: pi
   USE comvert_mod, ONLY: preff, ap, bp, aps, bps, presnivs, &
-                         scaleheight, pseudoalt
+                         scaleheight, pseudoalt, presinter
   USE vertical_layers_mod, ONLY: init_vertical_layers
   IMPLICIT NONE
@@ -233,5 +233,5 @@
   ! copy over preff , ap(), bp(), etc 
   CALL init_vertical_layers(nlayer,preff,scaleheight, &
-                            ap,bp,aps,bps,presnivs,pseudoalt)
+                            ap,bp,aps,bps,presnivs,presinter,pseudoalt)
 
 !$OMP END PARALLEL
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/callphysiq_mod.F90	(revision 4368)
@@ -20,6 +20,10 @@
 
   USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat
-  USE control_mod, ONLY: planet_type
+  USE control_mod, ONLY: planet_type, ok_dyn_xios
   USE physiq_mod, ONLY: physiq
+#ifdef CPP_XIOS
+  USE mod_xios_dyn3dmem, ONLY : dyn3d_ctx_handle
+  USE xios, ONLY : xios_set_current_context
+#endif
   IMPLICIT NONE
 
@@ -90,4 +94,13 @@
               zdpsrf_omp)
 
+! switching back to LMDZDYN context
+#ifdef CPP_XIOS
+!$OMP MASTER
+  if (ok_dyn_xios) then
+     CALL xios_set_current_context(dyn3d_ctx_handle)
+  endif
+!$OMP END MASTER
+#endif  
+
 
 END SUBROUTINE call_physiq
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/ce0l.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/ce0l.F90	(revision 4368)
@@ -23,5 +23,5 @@
   USE netcdf,         ONLY: NF90_OPEN, NF90_NOWRITE, NF90_CLOSE, NF90_NOERR,    &
          NF90_INQUIRE_DIMENSION, NF90_INQ_DIMID, NF90_INQ_VARID, NF90_GET_VAR
-  USE infotrac,       ONLY: type_trac, infotrac_init
+  USE infotrac,       ONLY: type_trac, init_infotrac
   USE dimphy,         ONLY: klon
   USE test_disvert_m, ONLY: test_disvert
@@ -108,5 +108,5 @@
   calnd='gregorian'
   SELECT CASE(calend)
-    CASE('earth_360d');CALL ioconf_calendar('360d');   calnd='with 360 days/year'
+    CASE('earth_360d');CALL ioconf_calendar('360_day');   calnd='with 360 days/year'
     CASE('earth_365d');CALL ioconf_calendar('noleap'); calnd='with no leap year'
     CASE('earth_366d');CALL ioconf_calendar('366d');   calnd='with leap years only'
@@ -132,5 +132,5 @@
 
 !--- Tracers initializations
-  CALL infotrac_init()
+  CALL init_infotrac()
 
   CALL inifilr()
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0dyn_netcdf.F90	(revision 4368)
@@ -39,4 +39,5 @@
   USE comvert_mod, ONLY: ap, bp, preff, pressure_exner
   USE temps_mod, ONLY: annee_ref, day_ref, itau_dyn, itau_phy, start_time
+  USE strings_mod, ONLY: strLower
   
   IMPLICIT NONE
@@ -74,5 +75,5 @@
   USE exner_hyb_m,    ONLY: exner_hyb
   USE exner_milieu_m, ONLY: exner_milieu
-  USE infotrac,       ONLY: nqtot, tname
+  USE infotrac,       ONLY: nqtot, tracers
   USE filtreg_mod
   IMPLICIT NONE
@@ -84,5 +85,5 @@
 ! Local variables:
   CHARACTER(LEN=256) :: modname, fmt
-  INTEGER            :: i, j, l, ji, itau, iday
+  INTEGER            :: i, j, l, ji, itau, iday, iq
   REAL               :: xpn, xps, time, phystep
   REAL, DIMENSION(iip1,jjp1)       :: psol
@@ -145,10 +146,10 @@
 ! Look for ozone tracer:
 #ifndef INCA
-  DO i=1,nqtot; IF(ANY(["O3","o3"]==tname(i))) EXIT; END DO
-  IF(i/=nqtot+1) THEN
+  DO iq=1,nqtot; IF(strLower(tracers(iq)%name)=="o3") EXIT; END DO
+  IF(iq/=nqtot+1) THEN
     CALL regr_lat_time_coefoz
     CALL press_coefoz
-    CALL regr_pr_o3(p3d, q3d(:,:,:,i))
-    q3d(:,:,:,i)=q3d(:,:,:,i)*48./ 29.                  !--- Mole->mass fraction         
+    CALL regr_pr_o3(p3d, q3d(:,:,:,iq))
+    q3d(:,:,:,iq)=q3d(:,:,:,iq)*48./ 29.                !--- Mole->mass fraction         
   END IF
 #endif
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90	(revision 4368)
@@ -94,5 +94,5 @@
   USE init_ssrf_m, ONLY: start_init_subsurf
   USE phys_state_var_mod, ONLY: beta_aridity, delta_tsurf, awake_dens, cv_gen, &
-       ratqs_inter
+       ratqs_inter, rneb_ancien
   !use ioipsl_getincom
   IMPLICIT NONE
@@ -130,5 +130,5 @@
 
   INCLUDE "compbl.h"
-  INCLUDE "thermcell.h"
+  INCLUDE "alpale.h"
   
   deg2rad= pi/180.0
@@ -286,4 +286,5 @@
 
   ratqs_inter = 0.002
+  rneb_ancien = 0.
   CALL phyredem( "startphy.nc" )
 
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/iniphysiq_mod.F90	(revision 4368)
@@ -16,15 +16,7 @@
   USE mod_phys_lmdz_para, ONLY: klon_omp ! number of columns (on local omp grid)
   USE vertical_layers_mod, ONLY : init_vertical_layers
-  USE infotrac, ONLY: nqtot,nqo,nbtr,nqCO2,tname,ttext,type_trac,&
-                      niadv,conv_flg,pbl_flg,solsym,&
-                      nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,&
-                      ok_isotopes,ok_iso_verif,ok_isotrac,&
-                      ok_init_iso,niso_possibles,tnat,&
-                      alpha_ideal,use_iso,iqiso,iso_num,&
-                      iso_indnum,zone_num,phase_num,&
-                      indnum_fn_num,index_trac,&
-                      niso,ntraceurs_zone,ntraciso,nqtottr,itr_indice
+  USE infotrac, ONLY: nbtr, type_trac, types_trac
 #ifdef CPP_StratAer
-  USE infotrac, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, &
+  USE infotrac_phy, ONLY: nbtr_bin, nbtr_sulgas, id_OCS_strat, &
                       id_SO2_strat, id_H2SO4_strat, id_BIN01_strat
 
@@ -38,5 +30,5 @@
   USE mod_phys_lmdz_omp_data, ONLY: klon_omp
 #endif
-  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq, config_inca
+  USE control_mod, ONLY: dayref,anneeref,day_step,nday,offline, iphysiq
   USE inifis_mod, ONLY: inifis
   USE time_phylmdz_mod, ONLY: init_time
@@ -116,7 +108,6 @@
   
 !!$OMP PARALLEL DEFAULT(SHARED) COPYIN(/temps/)
-!$OMP PARALLEL DEFAULT(SHARED) &
 !	Copy all threadprivate variables in temps_mod
-!$OMP COPYIN(annee_ref, day_ini, day_ref, start_time)
+!$OMP PARALLEL DEFAULT(SHARED) COPYIN(annee_ref,day_ini,day_ref,start_time)
 
   ! Initialize physical constants in physics:
@@ -146,21 +137,8 @@
 
   ! Initialize tracer names, numbers, etc. for physics
-  CALL init_infotrac_phy(nqtot,nqo,nbtr,nqtottr,nqCO2,tname,ttext,type_trac,&
-                         niadv,conv_flg,pbl_flg,solsym,&
-                         nqfils,nqdesc,nqdesc_tot,iqfils,iqpere,&
-                         ok_isotopes,ok_iso_verif,ok_isotrac,&
-                         ok_init_iso,niso_possibles,tnat,&
-                         alpha_ideal,use_iso,iqiso,iso_num,&
-                         iso_indnum,zone_num,phase_num,&
-                         indnum_fn_num,index_trac,&
-                         niso,ntraceurs_zone,ntraciso,itr_indice &
-#ifdef CPP_StratAer
-                         ,nbtr_bin,nbtr_sulgas&
-                         ,id_OCS_strat,id_SO2_strat,id_H2SO4_strat,id_BIN01_strat&
-#endif
-                         )
+  CALL init_infotrac_phy
 
   ! Initializations for Reprobus
-  IF (type_trac == 'repr') THEN
+  IF (ANY(types_trac == 'repr')) THEN
 #ifdef REPROBUS
     call Init_chem_rep_phys(klon_omp,nlayer)
@@ -172,16 +150,6 @@
 !$OMP END PARALLEL
 
-  IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
-#ifdef INCA
-     call init_const_lmdz( &
-          anneeref,dayref, iphysiq,day_step,nday,  &
-          nbsrf, is_oce,is_sic, is_ter,is_lic, calend, &
-          config_inca)
-     call init_inca_para( &
-          nbp_lon,nbp_lat,nbp_lev,klon_glo,mpi_size, &
-          distrib_phys,communicator)
-#endif
-  END IF
-  IF (type_trac == 'repr') THEN
+
+  IF (ANY(types_trac == 'repr')) THEN
 #ifdef REPROBUS
     call init_reprobus_para( &
@@ -198,14 +166,9 @@
   END IF
 
-  IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
+  IF (ANY(types_trac == 'inca') .OR. ANY(types_trac == 'inco')) THEN
 #ifdef INCA
-     CALL init_inca_dim(klon_omp,nbp_lev,nbp_lon,nbp_lat - 1, &
-          rlonudyn,rlatudyn,rlonvdyn,rlatvdyn)
+     CALL init_inca_dim_reg(nbp_lon, nbp_lat - 1, &
+          rlonudyn, rlatudyn, rlonvdyn, rlatvdyn)
 #endif
-    IF (type_trac == 'repr') THEN
-#ifdef REPROBUS
-       CALL Init_chem_rep_phys(klon_omp,nbp_lev)
-#endif
-    END IF
   END IF
 
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/init_ssrf_m.F90	(revision 4368)
@@ -3,12 +3,13 @@
 !*******************************************************************************
 
-  USE indice_sol_mod, ONLY: is_ter, is_oce, is_oce, is_lic, epsfra
+  USE indice_sol_mod,     ONLY: is_ter, is_oce, is_oce, is_lic, epsfra
   USE dimphy,             ONLY: klon, zmasq
   USE phys_state_var_mod, ONLY: pctsrf
-  USE geometry_mod, ONLY : longitude_deg, latitude_deg
+  USE geometry_mod,       ONLY : longitude_deg, latitude_deg
   USE grid_atob_m,        ONLY: grille_m
   USE ioipsl,             ONLY: flininfo, flinopen, flinget, flinclo
   USE ioipsl_getin_p_mod, ONLY: getin_p
-  USE comconst_mod, ONLY: im, pi
+  USE comconst_mod,       ONLY: im, pi
+  USE surface_data,       ONLY: landice_opt
 
   CHARACTER(LEN=256), PARAMETER :: icefname="landiceref.nc", icevar="landice"
@@ -58,64 +59,75 @@
 ! Sub-surfaces initialization
 !*******************************************************************************
-!--- Read and interpolate on model T-grid soil fraction and soil ice fraction.
-  CALL flininfo(icefname, iml_lic, jml_lic, llm_tmp, ttm_tmp, fid)
-  ALLOCATE(lat_lic(iml_lic,jml_lic),lon_lic(iml_lic,jml_lic))
-  ALLOCATE(fraclic(iml_lic,jml_lic))
-  CALL flinopen(icefname, .FALSE., iml_lic, jml_lic, llm_tmp,  &
- &               lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
-  CALL flinget(fid, icevar, iml_lic, jml_lic, llm_tmp, ttm_tmp, 1,1, fraclic)
-  CALL flinclo(fid)
-  WRITE(lunout,*)'landice dimensions: iml_lic, jml_lic : ',iml_lic,jml_lic
+  IF (landice_opt .LT. 2) THEN
+     ! Continue with reading landice.nc file
+     WRITE(lunout,*)"Read landice.nc file to attribute is_lic fraction"
 
-  ALLOCATE(dlon_lic(iml_lic),dlat_lic(jml_lic))
-  dlon_lic(:)=lon_lic(:,1); IF(MAXVAL(dlon_lic)>pi) dlon_lic=dlon_lic*pi/180.
-  dlat_lic(:)=lat_lic(1,:); IF(MAXVAL(dlat_lic)>pi) dlat_lic=dlat_lic*pi/180.
-  DEALLOCATE(lon_lic,lat_lic); ALLOCATE(flic_tmp(iip1,jjp1))
-  CALL grille_m(dlon_lic,dlat_lic,fraclic,rlonv(1:iim),rlatu,flic_tmp(1:iim,:))
-  flic_tmp(iip1,:)=flic_tmp(1,:)
-
-!--- To the physical grid
-  pctsrf(:,:) = 0.
-  CALL gr_dyn_fi(1, iip1, jjp1, klon, flic_tmp, pctsrf(:,is_lic))
-  DEALLOCATE(flic_tmp)
-
-!--- Adequation with soil/sea mask
-  WHERE(pctsrf(:,is_lic)<EPSFRA) pctsrf(:,is_lic)=0. 
-  WHERE(zmasq(:)<EPSFRA)         pctsrf(:,is_lic)=0.
-  pctsrf(:,is_ter)=zmasq(:)
-  DO ji=1,klon
-    IF(zmasq(ji)>EPSFRA) THEN 
-      IF(pctsrf(ji,is_lic)>=zmasq(ji)) THEN
-        pctsrf(ji,is_lic)=zmasq(ji)
-        pctsrf(ji,is_ter)=0.
-      ELSE
-        pctsrf(ji,is_ter)=zmasq(ji)-pctsrf(ji,is_lic)
-        IF(pctsrf(ji,is_ter)<EPSFRA) THEN
-          pctsrf(ji,is_ter)=0.
-          pctsrf(ji,is_lic)=zmasq(ji)
-        END IF 
-      END IF 
-    END IF 
-  END DO 
-
-
-  !--- Option no_ter_antartique removes all land fractions souther than 60S.
-  !--- Land ice is set instead of the land fractions on these latitudes.
-  !--- The ocean and sea-ice fractions are not changed.
-  no_ter_antartique=.FALSE.
-  CALL getin_p('no_ter_antartique',no_ter_antartique)
-  WRITE(lunout,*)"no_ter_antartique=",no_ter_antartique
-  IF (no_ter_antartique) THEN
-     ! Remove all land fractions souther than 60S and set land-ice instead
-     WRITE(lunout,*) "Remove land fractions souther than 60deg south by increasing"
-     WRITE(lunout,*) "the continental ice fractions. No land can now be found at Antartic."
-     DO ji=1, klon
-        IF (latitude_deg(ji)<-60.0) THEN
-           pctsrf(ji,is_lic) = pctsrf(ji,is_lic) + pctsrf(ji,is_ter)
-           pctsrf(ji,is_ter) = 0
+     !--- Read and interpolate on model T-grid soil fraction and soil ice fraction.
+     CALL flininfo(icefname, iml_lic, jml_lic, llm_tmp, ttm_tmp, fid)
+     ALLOCATE(lat_lic(iml_lic,jml_lic),lon_lic(iml_lic,jml_lic))
+     ALLOCATE(fraclic(iml_lic,jml_lic))
+     CALL flinopen(icefname, .FALSE., iml_lic, jml_lic, llm_tmp,  &
+          &               lon_lic, lat_lic, lev, ttm_tmp, itaul, date, dt, fid)
+     CALL flinget(fid, icevar, iml_lic, jml_lic, llm_tmp, ttm_tmp, 1,1, fraclic)
+     CALL flinclo(fid)
+     WRITE(lunout,*)'landice dimensions: iml_lic, jml_lic : ',iml_lic,jml_lic
+     
+     ALLOCATE(dlon_lic(iml_lic),dlat_lic(jml_lic))
+     dlon_lic(:)=lon_lic(:,1); IF(MAXVAL(dlon_lic)>pi) dlon_lic=dlon_lic*pi/180.
+     dlat_lic(:)=lat_lic(1,:); IF(MAXVAL(dlat_lic)>pi) dlat_lic=dlat_lic*pi/180.
+     DEALLOCATE(lon_lic,lat_lic); ALLOCATE(flic_tmp(iip1,jjp1))
+     CALL grille_m(dlon_lic,dlat_lic,fraclic,rlonv(1:iim),rlatu,flic_tmp(1:iim,:))
+     flic_tmp(iip1,:)=flic_tmp(1,:)
+     
+     !--- To the physical grid
+     pctsrf(:,:) = 0.
+     CALL gr_dyn_fi(1, iip1, jjp1, klon, flic_tmp, pctsrf(:,is_lic))
+     DEALLOCATE(flic_tmp)
+     
+     !--- Adequation with soil/sea mask
+     WHERE(pctsrf(:,is_lic)<EPSFRA) pctsrf(:,is_lic)=0. 
+     WHERE(zmasq(:)<EPSFRA)         pctsrf(:,is_lic)=0.
+     pctsrf(:,is_ter)=zmasq(:)
+     DO ji=1,klon
+        IF(zmasq(ji)>EPSFRA) THEN 
+           IF(pctsrf(ji,is_lic)>=zmasq(ji)) THEN
+              pctsrf(ji,is_lic)=zmasq(ji)
+              pctsrf(ji,is_ter)=0.
+           ELSE
+              pctsrf(ji,is_ter)=zmasq(ji)-pctsrf(ji,is_lic)
+              IF(pctsrf(ji,is_ter)<EPSFRA) THEN
+                 pctsrf(ji,is_ter)=0.
+                 pctsrf(ji,is_lic)=zmasq(ji)
+              END IF
+           END IF
         END IF
      END DO
+     
+     
+     !--- Option no_ter_antartique removes all land fractions souther than 60S.
+     !--- Land ice is set instead of the land fractions on these latitudes.
+     !--- The ocean and sea-ice fractions are not changed.
+     no_ter_antartique=.FALSE.
+     CALL getin_p('no_ter_antartique',no_ter_antartique)
+     WRITE(lunout,*)"no_ter_antartique=",no_ter_antartique
+     IF (no_ter_antartique) THEN
+        ! Remove all land fractions souther than 60S and set land-ice instead
+        WRITE(lunout,*) "Remove land fractions souther than 60deg south by increasing"
+        WRITE(lunout,*) "the continental ice fractions. No land can now be found at Antartic."
+        DO ji=1, klon
+           IF (latitude_deg(ji)<-60.0) THEN
+              pctsrf(ji,is_lic) = pctsrf(ji,is_lic) + pctsrf(ji,is_ter)
+              pctsrf(ji,is_ter) = 0
+           END IF
+        END DO
+     END IF
+     
+  ELSE
+     ! landice_opt=2 and higher
+     WRITE(lunout,*) 'No landice is attributed is_lic sub-surface because landice_opt=2 or higher.'
+     WRITE(lunout,*) 'This means that the land model will handel land ice as well as all other land areas.'
+     pctsrf(:,is_ter) = zmasq(:)
+     pctsrf(:,is_lic) = 0.0
   END IF
-
 
 !--- Sub-surface ocean and sea ice (sea ice set to zero for start).
Index: LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/limit_netcdf.F90
===================================================================
--- LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/limit_netcdf.F90	(revision 4022)
+++ LMDZ6/branches/Ocean_skin/libf/dynphy_lonlat/phylmd/limit_netcdf.F90	(revision 4368)
@@ -424,5 +424,5 @@
   IF(NF90_GET_ATT(ncid, varid, 'calendar', cal_in)/=NF90_NOERR) THEN
     SELECT CASE(mode)
-      CASE('RUG', 'ALB'); cal_in='360d'
+      CASE('RUG', 'ALB'); cal_in='360_day'
       CASE('SIC', 'SST'); cal_in='gregorian'
     END SELECT
@@ -492,5 +492,5 @@
       !--- DROPPED FOR BCS DATA (FRACTIONS CAN BE HIGHER THAN 1)
       IF(ll.AND.ix_sic/=1.AND.mode=='SIC') &
-        CALL abort_physic(mode,'unrealistic '//TRIM(mode)//' found: '//TRIM(str))
+        CALL abort_physic(mode,'unrealistic '//TRIM(mode)//' found: '//TRIM(str), 1)
 
     END IF
@@ -641,5 +641,5 @@
   ALLOCATE(champo(klon, ndays))
   DO k=1, ndays
-    CALL gr_dyn_fi(1, iip1, jjp1, klon, champan(1, 1, k), champo(1, k))
+    CALL gr_dyn_fi(1, iip1, jjp1, klon, champan(1, 1, k), champo(:, k))
   END DO
   DEALLOCATE(champan)
