Index: /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3231)
+++ /trunk/LMDZ.GENERIC/libf/phystd/physiq_mod.F90	(revision 3232)
@@ -1,8 +1,8 @@
       module physiq_mod
-      
+
       implicit none
-      
+
       contains
-      
+
       subroutine physiq(ngrid,nlayer,nq,   &
                   firstcall,lastcall,      &
@@ -14,7 +14,7 @@
 
 !!
-      use write_field_phy, only: Writefield_phy  
+      use write_field_phy, only: Writefield_phy
 !!
-      use ioipsl_getin_p_mod, only: getin_p 
+      use ioipsl_getin_p_mod, only: getin_p
       use radinc_h, only : L_NSPECTI,L_NSPECTV,naerkind, corrkdir, banddir
       use watercommon_h, only : RLVTT, Psat_water,epsi,su_watercycle, RV, T_h2o_ice_liq
@@ -80,5 +80,5 @@
       use turb_mod, only : q2,sensibFlux,turb_resolved
       use mass_redistribution_mod, only: mass_redistribution
-      use condensation_generic_mod, only: condensation_generic 
+      use condensation_generic_mod, only: condensation_generic
       use datafile_mod, only: datadir
 #ifndef MESOSCALE
@@ -98,5 +98,5 @@
 #endif
 
-#ifdef CPP_XIOS      
+#ifdef CPP_XIOS
       use xios_output_mod, only: initialize_xios_output, &
                                  update_xios_timestep, &
@@ -109,5 +109,5 @@
 
 !==================================================================
-!     
+!
 !     Purpose
 !     -------
@@ -199,10 +199,10 @@
 !           Frederic Hourdin        15/10/93
 !           Francois Forget        1994
-!           Christophe Hourdin        02/1997 
+!           Christophe Hourdin        02/1997
 !           Subroutine completely rewritten by F. Forget (01/2000)
 !           Water ice clouds: Franck Montmessin (update 06/2003)
 !           Radiatively active tracers: J.-B. Madeleine (10/2008-06/2009)
 !           New correlated-k radiative scheme: R. Wordsworth (2009)
-!           Many specifically Martian subroutines removed: R. Wordsworth (2009)       
+!           Many specifically Martian subroutines removed: R. Wordsworth (2009)
 !           Improved water cycle: R. Wordsworth / B. Charnay (2010)
 !           To F90: R. Wordsworth (2010)
@@ -229,8 +229,8 @@
       integer,intent(in) :: nlayer            ! Number of atmospheric layers.
       integer,intent(in) :: nq                ! Number of tracers.
-      
+
       logical,intent(in) :: firstcall ! Signals first call to physics.
       logical,intent(in) :: lastcall  ! Signals last call to physics.
-      
+
       real,intent(in) :: pday                  ! Number of elapsed sols since reference Ls=0.
       real,intent(in) :: ptime                 ! "Universal time", given as fraction of sol (e.g.: 0.5 for noon).
@@ -265,5 +265,5 @@
 ! -----------------
 
-!     Aerosol (dust or ice) extinction optical depth  at reference wavelength 
+!     Aerosol (dust or ice) extinction optical depth  at reference wavelength
 !     for the "naerkind" optically active aerosols:
 
@@ -276,5 +276,5 @@
       integer l,ig,ierr,iq,nw,isoil,iesp, igcm_generic_vap, igcm_generic_ice
       logical call_ice_vap_generic ! to call only one time the ice/vap pair of a tracer
-      
+
       real zls                       ! Solar longitude (radians).
       real zlss                      ! Sub solar point longitude (radians).
@@ -284,5 +284,5 @@
 
 ! VARIABLES for the thermal plume model
-      
+
       real f(ngrid)                       ! Mass flux norm
       real fm(ngrid,nlayer+1)             ! Mass flux
@@ -297,5 +297,5 @@
       real zw2(ngrid,nlayer+1)            ! Vertical speed
       real zw2_bis(ngrid,nlayer)          ! Recasted zw2
-      
+
 ! TENDENCIES due to various processes :
 
@@ -306,8 +306,8 @@
       real zdtsdif(ngrid)     ! Turbdiff/vdifc routines.
       real zdtsurf_hyd(ngrid) ! Hydrol routine.
-            
-      ! For Atmospheric Temperatures : (K/s)    
+
+      ! For Atmospheric Temperatures : (K/s)
       real dtlscale(ngrid,nlayer)                             ! Largescale routine.
-      real dt_generic_condensation(ngrid,nlayer)              ! condensation_generic routine. 
+      real dt_generic_condensation(ngrid,nlayer)              ! condensation_generic routine.
       real zdtc(ngrid,nlayer)                                 ! Condense_co2 routine.
       real zdtdif(ngrid,nlayer)                               ! Turbdiff/vdifc routines.
@@ -320,5 +320,5 @@
       real zdtsw1(ngrid,nlayer), zdtlw1(ngrid,nlayer)         ! Callcorrk routine.
       real zdtchim(ngrid,nlayer)                              ! Calchim routine.
-                              
+
       ! For Surface Tracers : (kg/m2/s)
       real dqsurf(ngrid,nq)                 ! Cumulated tendencies.
@@ -332,5 +332,5 @@
       real reevap_precip(ngrid)             ! re-evaporation flux of precipitation (integrated over the atmospheric column)
       real reevap_precip_generic(ngrid,nq)
-                  
+
       ! For Tracers : (kg/kg_of_air/s)
       real zdqc(ngrid,nlayer,nq)      ! Condense_co2 routine.
@@ -355,5 +355,5 @@
       REAL array_zero1(ngrid)
       REAL array_zero2(ngrid,nlayer)
-                        
+
       ! For Winds : (m/s/s)
       real zdvadj(ngrid,nlayer), zduadj(ngrid,nlayer)       ! Convadj routine.
@@ -363,5 +363,5 @@
       real zdhdif(ngrid,nlayer)                             ! Turbdiff/vdifc routines.
       real zdhadj(ngrid,nlayer)                             ! Convadj routine.
-     
+
       ! For Pressure and Mass :
       real zdmassmr(ngrid,nlayer) ! Atmospheric Mass tendency for mass_redistribution (kg_of_air/m2/s).
@@ -369,6 +369,6 @@
       real zdpsrfmr(ngrid)        ! Pressure tendency for mass_redistribution routine (Pa/s).
 
-      
-    
+
+
 ! Local variables for LOCAL CALCULATIONS:
 ! ---------------------------------------
@@ -395,7 +395,7 @@
       real vmr(ngrid,nlayer)                        ! volume mixing ratio
       real time_phys
-      
+
       real ISR,ASR,OLR,GND,DYN,GSR,Ts1,Ts2,Ts3,TsS ! for Diagnostic.
-      
+
       real qcol(ngrid,nq) ! Tracer Column Mass (kg/m2).
 
@@ -410,8 +410,8 @@
       real,save :: dEtotSW, dEtotsSW, dEtotLW, dEtotsLW
 !$OMP THREADPRIVATE(dEtotSW, dEtotsSW, dEtotLW, dEtotsLW)
-      
+
 !JL12 conservation test for mean flow kinetic energy has been disabled temporarily
 
-      real dtmoist_max,dtmoist_min     
+      real dtmoist_max,dtmoist_min
       real dItot, dItot_tmp, dVtot, dVtot_tmp
 
@@ -437,5 +437,5 @@
 
       logical clearsky ! For double radiative transfer call. By BC
-      
+
       ! For Clear Sky Case.
       real fluxsurfabs_sw1(ngrid)  ! For SW/LW flux.
@@ -466,5 +466,5 @@
       real :: flux_sens_lat(ngrid)
       real :: qsurfint(ngrid,nq)
-#ifdef MESOSCALE 
+#ifdef MESOSCALE
       REAL :: lsf_dt(nlayer)
       REAL :: lsf_dq(nlayer)
@@ -474,9 +474,9 @@
       logical, save ::  check_physics_inputs=.false.
       logical, save ::  check_physics_outputs=.false.
-!$OPM THREADPRIVATE(check_physics_inputs,check_physics_outputs)     
+!$OPM THREADPRIVATE(check_physics_inputs,check_physics_outputs)
 
       ! Misc
       character*2 :: str2
-      character(len=10) :: tmp1 
+      character(len=10) :: tmp1
       character(len=10) :: tmp2
 !==================================================================================================
@@ -534,5 +534,5 @@
 !        Read 'startfi.nc' file.
 !        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#ifndef MESOSCALE 
+#ifndef MESOSCALE
          call phyetat0(startphy_file,                                 &
                        ngrid,nlayer,"startfi.nc",0,0,nsoilmx,nq,      &
@@ -541,5 +541,5 @@
                        rnat,pctsrf_sic,tslab, tsea_ice,sea_ice)
 
-#else   
+#else
 
          day_ini = pday
@@ -555,5 +555,5 @@
              tsoil(1:ngrid,isoil)=tsurf(1:ngrid)
            enddo
-           if (is_master) write(*,*) "Physiq: initializing day_ini to pdat !"
+           if (is_master) write(*,*) "Physiq: initializing day_ini to pday !"
            day_ini=pday
          endif
@@ -569,5 +569,5 @@
          write (*,*) 'In physiq day_ini =', day_ini
 
-!        Initialize albedo calculation. 
+!        Initialize albedo calculation.
 !        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          albedo(:,:)=0.0
@@ -575,7 +575,7 @@
          albedo_snow_SPECTV(:)=0.0
          albedo_co2_ice_SPECTV(:)=0.0
-         call surfini(ngrid,nq,qsurf,albedo,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV) 
-
-!        Initialize orbital calculation. 
+         call surfini(ngrid,nq,qsurf,albedo,albedo_bareground,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
+
+!        Initialize orbital calculation.
 !        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          call iniorbit(apoastr,periastr,year_day,peri_day,obliquit)
@@ -596,5 +596,5 @@
 
 !!           call ini_surf_heat_transp_mod()
-           
+
            knindex(:) = 0
            knon = 0
@@ -620,5 +620,5 @@
 !        ~~~~~~~~~~~~~~~~
          if (callsoil) then
-         
+
             call soil(ngrid,nsoilmx,firstcall,lastcall,inertiedat, &
                       ptimestep,tsurf,tsoil,capcal,fluxgrd)
@@ -639,12 +639,12 @@
 
          else ! else of 'callsoil'.
-         
+
             print*,'WARNING! Thermal conduction in the soil turned off'
             capcal(:)=1.e6
             fluxgrd(:)=intheat
             print*,'Flux from ground = ',intheat,' W m^-2'
-            
+
          endif ! end of 'callsoil'.
-         
+
          icount=1
 
@@ -653,5 +653,5 @@
          ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          if (.not.ok_slab_ocean) then
-         
+
            rnat(:)=1.
            if (.not.nosurf) then ! inertiedat only defined if there is a surface
@@ -691,14 +691,14 @@
          endif
 
-         if(meanOLR)then          
-            call system('rm -f rad_bal.out') ! to record global radiative balance.           
-            call system('rm -f tem_bal.out') ! to record global mean/max/min temperatures.            
+         if(meanOLR)then
+            call system('rm -f rad_bal.out') ! to record global radiative balance.
+            call system('rm -f tem_bal.out') ! to record global mean/max/min temperatures.
             call system('rm -f h2o_bal.out') ! to record global hydrological balance.
          endif
 
 
-         watertest=.false.        
+         watertest=.false.
          if(water)then ! Initialize variables for water cycle
-            
+
             if(enertest)then
                watertest = .true.
@@ -711,5 +711,5 @@
          metallicity=0.0 ! default value --- is not used here but necessary to call function Psat_generic
          call getin_p("metallicity",metallicity) ! --- is not used here but necessary to call function Psat_generic
-         
+
 !        Set some parameters for the thermal plume model
 !        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -731,8 +731,8 @@
 
 !!         call WriteField_phy("post_physdem_qsurf",qsurf(1:ngrid,igcm_h2o_vap),1)
-#endif         
-         if (corrk) then 
-            ! We initialise the spectral grid here instead of 
-            ! at firstcall of callcorrk so we can output XspecIR, XspecVI 
+#endif
+         if (corrk) then
+            ! We initialise the spectral grid here instead of
+            ! at firstcall of callcorrk so we can output XspecIR, XspecVI
             ! when using Dynamico
             print*, "physiq_mod: Correlated-k data base folder:",trim(datadir)
@@ -757,5 +757,5 @@
                                      year_day,presnivs,pseudoalt,WNOI,WNOV)
 #endif
-         
+
 !!         call WriteField_phy("post_xios_qsurf",qsurf(1:ngrid,igcm_h2o_vap),1)
 
@@ -764,5 +764,5 @@
 
 !!      call WriteField_phy("post_firstcall_qsurf",qsurf(1:ngrid,igcm_h2o_vap),1)
-!!      call writediagfi(ngrid,"firstcall_post_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap))  
+!!      call writediagfi(ngrid,"firstcall_post_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap))
 
       if (check_physics_inputs) then
@@ -778,15 +778,15 @@
 ! ------------------------------------------------------
 
-#ifdef CPP_XIOS      
+#ifdef CPP_XIOS
       ! update XIOS time/calendar
       call update_xios_timestep
-#endif      
+#endif
 
       ! Initialize various variables
       ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      
+
       if ( .not.nearco2cond ) then
          pdt(1:ngrid,1:nlayer) = 0.0
-      endif      
+      endif
       zdtsurf(1:ngrid)      = 0.0
       pdq(1:ngrid,1:nlayer,1:nq) = 0.0
@@ -795,5 +795,5 @@
       pdv(1:ngrid,1:nlayer) = 0.0
       pdpsrf(1:ngrid)       = 0.0
-      zflubid(1:ngrid)      = 0.0      
+      zflubid(1:ngrid)      = 0.0
       flux_sens_lat(1:ngrid) = 0.0
       taux(1:ngrid) = 0.0
@@ -811,5 +811,5 @@
 
       call orbite(zls,dist_star,declin,right_ascen)
-      
+
       if (tlocked) then
               zlss=Mod(-(2.*pi*(zday/year_day)*nres - right_ascen),2.*pi)
@@ -818,12 +818,12 @@
       else if(diurnal .eqv. .false.) then
               zlss=9999.
-      endif 
+      endif
 
 
       ! Compute variations of g with latitude (oblate case).
       ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      if (oblate .eqv. .false.) then      
-         glat(:) = g         
-      else if (flatten .eq. 0.0 .or. J2 .eq. 0.0 .or. Rmean .eq. 0.0 .or. MassPlanet .eq. 0.0) then      
+      if (oblate .eqv. .false.) then
+         glat(:) = g
+      else if (flatten .eq. 0.0 .or. J2 .eq. 0.0 .or. Rmean .eq. 0.0 .or. MassPlanet .eq. 0.0) then
          print*,'I need values for flatten, J2, Rmean and MassPlanet to compute glat (else set oblate=.false.)'
          call abort
@@ -831,5 +831,5 @@
          gmplanet = MassPlanet*grav*1e24
          do ig=1,ngrid
-            glat(ig)= gmplanet/(Rmean**2) * (1.D0 + 0.75 *J2 - 2.0*flatten/3. + (2.*flatten - 15./4.* J2) * cos(2. * (pi/2. - latitude(ig)))) 
+            glat(ig)= gmplanet/(Rmean**2) * (1.D0 + 0.75 *J2 - 2.0*flatten/3. + (2.*flatten - 15./4.* J2) * cos(2. * (pi/2. - latitude(ig))))
          end do
       endif
@@ -838,5 +838,5 @@
       ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       zzlay(1:ngrid,1:nlayer)=pphi(1:ngrid,1:nlayer)
-      do l=1,nlayer         
+      do l=1,nlayer
          zzlay(1:ngrid,l)= zzlay(1:ngrid,l)/glat(1:ngrid)
       enddo
@@ -850,8 +850,8 @@
             zzlev(ig,l)=(z1*zzlay(ig,l-1)+z2*zzlay(ig,l))/(z1+z2)
          enddo
-      enddo     
+      enddo
 
       !Altitude of top interface (nlayer+1), using the thicknesss of the level below the top one. LT22
-      
+
       zzlev(1:ngrid,nlayer+1) = 2*zzlev(1:ngrid,nlayer)-zzlev(1:ngrid,nlayer-1)
 
@@ -859,5 +859,5 @@
       ! Note : Potential temperature calculation may not be the same in physiq and dynamic...
       ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-      do l=1,nlayer         
+      do l=1,nlayer
          do ig=1,ngrid
             zpopsk(ig,l)=(pplay(ig,l)/pplev(ig,1))**rcp
@@ -894,5 +894,5 @@
       if(photochem) then
          call concentrations(ngrid,nlayer,nq,pplay,pt,pdt,pq,pdq,ptimestep)
-      endif 
+      endif
 #endif
 
@@ -928,20 +928,20 @@
          endif
 
-      endif 
+      endif
 
       if (callrad) then
          if( mod(icount-1,iradia).eq.0.or.lastcall) then
-           
-            ! Eclipse incoming sunlight (e.g. Saturn ring shadowing).       
+
+            ! Eclipse incoming sunlight (e.g. Saturn ring shadowing).
             if(rings_shadow) then
                 call call_rings(ngrid, ptime, pday, diurnal)
-            endif   
+            endif
 
 !!            call writediagfi(ngrid,"corrk_pre_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_vap))
-!!            call writediagfi(ngrid,"corrk_pre_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap)) 
+!!            call writediagfi(ngrid,"corrk_pre_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap))
 
 
             if (corrk) then
-            
+
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ! II.a Call correlated-k radiative transfer scheme
@@ -952,6 +952,6 @@
                endif
                if(water) then
-                  muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,1:nlayer,igcm_h2o_vap)) 
-                  muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,nlayer,igcm_h2o_vap)) 
+                  muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,1:nlayer,igcm_h2o_vap))
+                  muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi-1.e0)*pq(1:ngrid,nlayer,igcm_h2o_vap))
                   ! take into account water effect on mean molecular weight
                elseif(generic_condensation) then
@@ -959,23 +959,23 @@
 
                      call generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
-                     
+
                      if (call_ice_vap_generic) then ! to call only one time the ice/vap pair of a tracer
 
                         epsi_generic=constants_epsi_generic(iq)
 
-                        muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,1:nlayer,igcm_generic_vap)) 
-                        muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,nlayer,igcm_generic_vap))  
+                        muvar(1:ngrid,1:nlayer)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,1:nlayer,igcm_generic_vap))
+                        muvar(1:ngrid,nlayer+1)=mugaz/(1.e0+(1.e0/epsi_generic-1.e0)*pq(1:ngrid,nlayer,igcm_generic_vap))
 
                      endif
-                  end do ! do iq=1,nq loop on tracers 
+                  end do ! do iq=1,nq loop on tracers
                ! take into account generic condensable specie (GCS) effect on mean molecular weight
-               
+
                else
                   muvar(1:ngrid,1:nlayer+1)=mugaz
-               endif 
-      
+               endif
+
 
                if(ok_slab_ocean) then
-                  tsurf2(:)=tsurf(:) 
+                  tsurf2(:)=tsurf(:)
                   do ig=1,ngrid
                      if (nint(rnat(ig))==0) then
@@ -984,5 +984,5 @@
                   enddo
                endif !(ok_slab_ocean)
-                
+
                ! standard callcorrk
                clearsky=.false.
@@ -995,13 +995,13 @@
                               int_dtaui,int_dtauv,                                &
                               tau_col,cloudfrac,totcloudfrac,                     &
-                              clearsky,firstcall,lastcall)     
+                              clearsky,firstcall,lastcall)
 
                 !GG (feb2021): Option to "artificially" decrease the raditive time scale in
                 !the deep atmosphere  press > 0.1 bar. Suggested by MT.
-                !! COEFF_RAD to be "tuned" to facilitate convergence of tendency 
-        
+                !! COEFF_RAD to be "tuned" to facilitate convergence of tendency
+
                 !coeff_rad=0.   ! 0 values, it doesn't accelerate the convergence
                 !coeff_rad=0.5
-                !coeff_rad=1.                 
+                !coeff_rad=1.
                 !do l=1, nlayer
                 !  do ig=1,ngrid
@@ -1013,5 +1013,5 @@
                 !enddo
 
-                ! Option to call scheme once more for clear regions  
+                ! Option to call scheme once more for clear regions
                if(CLFvarying)then
 
@@ -1027,10 +1027,10 @@
                                  tau_col1,cloudfrac,totcloudfrac,                    &
                                  clearsky,firstcall,lastcall)
-                  clearsky = .false.  ! just in case.     
+                  clearsky = .false.  ! just in case.
 
                   ! Sum the fluxes and heating rates from cloudy/clear cases
                   do ig=1,ngrid
                      tf=totcloudfrac(ig)
-                     ntf=1.-tf                    
+                     ntf=1.-tf
                      fluxsurf_lw(ig)       = ntf*fluxsurf_lw1(ig)       + tf*fluxsurf_lw(ig)
                      fluxsurf_sw(ig)       = ntf*fluxsurf_sw1(ig)       + tf*fluxsurf_sw(ig)
@@ -1040,16 +1040,16 @@
                      fluxabs_sw(ig)        = ntf*fluxabs_sw1(ig)        + tf*fluxabs_sw(ig)
                      tau_col(ig)           = ntf*tau_col1(ig)           + tf*tau_col(ig)
-                    
+
                      zdtlw(ig,1:nlayer) = ntf*zdtlw1(ig,1:nlayer) + tf*zdtlw(ig,1:nlayer)
                      zdtsw(ig,1:nlayer) = ntf*zdtsw1(ig,1:nlayer) + tf*zdtsw(ig,1:nlayer)
 
-                     OSR_nu(ig,1:L_NSPECTV) = ntf*OSR_nu1(ig,1:L_NSPECTV) + tf*OSR_nu(ig,1:L_NSPECTV)       
-                     GSR_nu(ig,1:L_NSPECTV) = ntf*GSR_nu1(ig,1:L_NSPECTV) + tf*GSR_nu(ig,1:L_NSPECTV)                  
-                     OLR_nu(ig,1:L_NSPECTI) = ntf*OLR_nu1(ig,1:L_NSPECTI) + tf*OLR_nu(ig,1:L_NSPECTI)                       
+                     OSR_nu(ig,1:L_NSPECTV) = ntf*OSR_nu1(ig,1:L_NSPECTV) + tf*OSR_nu(ig,1:L_NSPECTV)
+                     GSR_nu(ig,1:L_NSPECTV) = ntf*GSR_nu1(ig,1:L_NSPECTV) + tf*GSR_nu(ig,1:L_NSPECTV)
+                     OLR_nu(ig,1:L_NSPECTI) = ntf*OLR_nu1(ig,1:L_NSPECTI) + tf*OLR_nu(ig,1:L_NSPECTI)
                      if (diagdtau) then
-                       int_dtauv(ig,:,1:L_NSPECTV) = ntf*int_dtauv1(ig,:,1:L_NSPECTV) + tf*int_dtauv(ig,:,1:L_NSPECTV)                       
-                       int_dtaui(ig,:,1:L_NSPECTI) = ntf*int_dtaui1(ig,:,1:L_NSPECTI) + tf*int_dtaui(ig,:,1:L_NSPECTI)                       
+                       int_dtauv(ig,:,1:L_NSPECTV) = ntf*int_dtauv1(ig,:,1:L_NSPECTV) + tf*int_dtauv(ig,:,1:L_NSPECTV)
+                       int_dtaui(ig,:,1:L_NSPECTI) = ntf*int_dtaui1(ig,:,1:L_NSPECTI) + tf*int_dtaui(ig,:,1:L_NSPECTI)
                      endif
-                  enddo                               
+                  enddo
 
                endif ! end of CLFvarying.
@@ -1072,6 +1072,6 @@
                ! Net atmospheric radiative heating rate (K.s-1)
                dtrad(1:ngrid,1:nlayer)=zdtsw(1:ngrid,1:nlayer)+zdtlw(1:ngrid,1:nlayer)
-               
-               ! Late initialization of the Ice Spectral Albedo. We needed the visible bands to do that ! 
+
+               ! Late initialization of the Ice Spectral Albedo. We needed the visible bands to do that !
                if (firstcall .and. albedo_spectral_mode) then
                   call spectral_albedo_calc(albedo_snow_SPECTV)
@@ -1079,5 +1079,5 @@
 
             elseif(newtonian)then
-            
+
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ! II.b Call Newtonian cooling scheme
@@ -1089,7 +1089,7 @@
 
             else
-            
+
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-! II.c Atmosphere has no radiative effect 
+! II.c Atmosphere has no radiative effect
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                fluxtop_dn(1:ngrid)  = fract(1:ngrid)*mu0(1:ngrid)*Fat1AU/dist_star**2
@@ -1100,6 +1100,6 @@
                print*,'------------WARNING---WARNING------------' ! by MT2015.
                print*,'You are in corrk=false mode, '
-               print*,'and the surface albedo is taken equal to the first visible spectral value'               
-               
+               print*,'and the surface albedo is taken equal to the first visible spectral value'
+
                fluxsurfabs_sw(1:ngrid) = fluxtop_dn(1:ngrid)*(1.-albedo(1:ngrid,1))
                fluxrad_sky(1:ngrid)    = fluxsurfabs_sw(1:ngrid)
@@ -1111,5 +1111,5 @@
 
          endif ! of if(mod(icount-1,iradia).eq.0)
-       
+
 
          ! Transformation of the radiative tendencies
@@ -1119,5 +1119,5 @@
          fluxrad(1:ngrid)=fluxrad_sky(1:ngrid)-zplanck(1:ngrid)
          pdt(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)+dtrad(1:ngrid,1:nlayer)
-         
+
          ! Test of energy conservation
          !----------------------------
@@ -1152,10 +1152,10 @@
 
       if (calldifv) then
-      
+
          zflubid(1:ngrid)=fluxrad(1:ngrid)+fluxgrd(1:ngrid)
 
          ! JL12 the following if test is temporarily there to allow us to compare the old vdifc with turbdiff.
          if (UseTurbDiff) then
-         
+
             call turbdiff(ngrid,nlayer,nq,rnat,                  &
                           ptimestep,capcal,                      &
@@ -1168,7 +1168,7 @@
 
          else
-         
+
             zdh(1:ngrid,1:nlayer)=pdt(1:ngrid,1:nlayer)/zpopsk(1:ngrid,1:nlayer)
- 
+
             call vdifc(ngrid,nlayer,nq,rnat,zpopsk,           &
                        ptimestep,capcal,lwrite,               &
@@ -1199,5 +1199,5 @@
 !!         call writediagfi(ngrid,"vdifc_post_zdqsdif"," "," ",2,zdqsdif(1:ngrid,igcm_h2o_vap))
 
-         if (tracer) then 
+         if (tracer) then
            pdq(1:ngrid,1:nlayer,1:nq)=pdq(1:ngrid,1:nlayer,1:nq)+ zdqdif(1:ngrid,1:nlayer,1:nq)
            dqsurf(1:ngrid,1:nq)=dqsurf(1:ngrid,1:nq) + zdqsdif(1:ngrid,1:nq)
@@ -1210,5 +1210,5 @@
          !-------------------------
          if(enertest)then
-         
+
             dEzdiff(:,:)=cpp*mass(:,:)*zdtdif(:,:)
             do ig = 1, ngrid
@@ -1216,12 +1216,12 @@
                dEzdiff(ig,1)= dEzdiff(ig,1)+ sensibFlux(ig)! subtract flux to the ground
             enddo
-            
+
             call planetwide_sumval(dEdiff(:)*cell_area(:)/totarea_planet,dEtot)
             dEdiffs(:)=capcal(:)*zdtsdif(:)-zflubid(:)-sensibFlux(:)
             call planetwide_sumval(dEdiffs(:)*cell_area(:)/totarea_planet,dEtots)
             call planetwide_sumval(sensibFlux(:)*cell_area(:)/totarea_planet,AtmToSurf_TurbFlux)
-            
+
             if (is_master) then
-            
+
                if (UseTurbDiff) then
                          print*,'In TurbDiff sensible flux (atm=>surf) =',AtmToSurf_TurbFlux,' W m-2'
@@ -1234,5 +1234,5 @@
                end if
             endif ! end of 'is_master'
-            
+
          ! JL12 : note that the black body radiative flux emitted by the surface has been updated by the implicit scheme but not given back elsewhere.
          endif ! end of 'enertest'
@@ -1241,5 +1241,5 @@
          ! Test water conservation.
          if(watertest.and.water)then
-         
+
             call planetwide_sumval(massarea(:,:)*zdqdif(:,:,igcm_h2o_vap)*ptimestep/totarea_planet,dWtot_tmp)
             call planetwide_sumval(zdqsdif(:,igcm_h2o_vap)*cell_area(:)*ptimestep/totarea_planet,dWtots_tmp)
@@ -1253,5 +1253,5 @@
             do ig = 1, ngrid
                vdifcncons(ig)=vdifcncons(ig) + SUM(mass(ig,:)*zdqdif(ig,:,igcm_h2o_ice))
-            enddo            
+            enddo
             call planetwide_maxval(vdifcncons(:),nconsMAX)
 
@@ -1281,11 +1281,11 @@
 !   IV. Convection :
 !-------------------
-      
+
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
 ! IV.a Thermal plume model :
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~
-      
+
       IF (calltherm) THEN
-         
+
 ! AB: We need to evaporate ice before calling thermcell_main.
          IF (water) THEN
@@ -1295,5 +1295,5 @@
             zqtherm(:,:,:) = pq(:,:,:) + pdq(:,:,:) * ptimestep
          ENDIF
-         
+
          CALL thermcell_main(ngrid, nlayer, nq, ptimestep, firstcall,            &
                              pplay, pplev, pphi, zpopsk,                         &
@@ -1301,15 +1301,15 @@
                              zdutherm, zdvtherm, zdttherm, zdqtherm,             &
                              fm, entr, detr, zw2, fraca)
-         
+
          pdu(1:ngrid,1:nlayer) = pdu(1:ngrid,1:nlayer) + zdutherm(1:ngrid,1:nlayer)
          pdv(1:ngrid,1:nlayer) = pdv(1:ngrid,1:nlayer) + zdvtherm(1:ngrid,1:nlayer)
          pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer) + zdttherm(1:ngrid,1:nlayer)
-         
+
          IF (tracer) THEN
             pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqtherm(1:ngrid,1:nlayer,1:nq)
          ENDIF
-         
+
       ENDIF ! end of 'calltherm'
-      
+
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ! IV.b Dry convective adjustment :
@@ -1336,6 +1336,6 @@
          zdtadj(1:ngrid,1:nlayer) = zdhadj(1:ngrid,1:nlayer)*zpopsk(1:ngrid,1:nlayer) ! for diagnostic only
 
-         if(tracer) then 
-            pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqadj(1:ngrid,1:nlayer,1:nq) 
+         if(tracer) then
+            pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqadj(1:ngrid,1:nlayer,1:nq)
          end if
 
@@ -1356,5 +1356,5 @@
             do ig = 1, ngrid
                cadjncons(ig)=cadjncons(ig) + SUM(mass(ig,:)*zdqadj(ig,:,igcm_h2o_ice))
-            enddo            
+            enddo
             call planetwide_maxval(cadjncons(:),nconsMAX)
 
@@ -1363,7 +1363,7 @@
                print*,'In convadj MAX non-cons factor          =',nconsMAX,' kg m-2 s-1'
             endif
-            
+
          endif ! end of 'watertest'
-         
+
       endif ! end of 'calladj'
 !----------------------------------------------
@@ -1394,5 +1394,5 @@
 
 
-      
+
 !-----------------------------------------------
 !   V. Carbon dioxide condensation-sublimation :
@@ -1400,5 +1400,5 @@
 
       if (co2cond) then
-      
+
          if (.not.tracer) then
             print*,'We need a CO2 ice tracer to condense CO2'
@@ -1435,21 +1435,21 @@
 
 !---------------------------------------------
-!   VI. Specific parameterizations for tracers 
+!   VI. Specific parameterizations for tracers
 !---------------------------------------------
 
       if (tracer) then
-      
+
   ! ---------------------
   !   VI.1. Water and ice
   ! ---------------------
          if (water) then
-            
+
             ! Water ice condensation in the atmosphere
             if(watercond.and.(RLVTT.gt.1.e-8))then
-               
+
                if ((.not.calltherm).and.moistadjustment) then
                   dqmoist(1:ngrid,1:nlayer,1:nq)=0.
                   dtmoist(1:ngrid,1:nlayer)=0.
-                  
+
                   ! Moist Convective Adjustment.
                   ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1462,5 +1462,5 @@
 !!!!
                   call moistadj(ngrid,nlayer,nq,pt,pq,pdq,pplev,pplay,dtmoist,dqmoist,ptimestep,rneb_man)
-               
+
                   pdq(1:ngrid,1:nlayer,igcm_h2o_vap) = pdq(1:ngrid,1:nlayer,igcm_h2o_vap)     &
                                                      + dqmoist(1:ngrid,1:nlayer,igcm_h2o_vap)
@@ -1468,5 +1468,5 @@
                                                      + dqmoist(1:ngrid,1:nlayer,igcm_h2o_ice)
                   pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+dtmoist(1:ngrid,1:nlayer)
-                   
+
                   ! Test energy conservation.
                   if(enertest)then
@@ -1475,9 +1475,9 @@
                      call planetwide_minval(dtmoist(:,:),dtmoist_min)
                      madjdEz(:,:)=cpp*mass(:,:)*dtmoist(:,:)
-                     
+
                      do ig=1,ngrid
                         madjdE(ig) = cpp*SUM(mass(:,:)*dtmoist(:,:))
                      enddo
-                     
+
                      if (is_master) then
                         print*,'In moistadj atmospheric energy change   =',dEtot,' W m-2'
@@ -1485,9 +1485,9 @@
                         print*,'In moistadj MIN atmospheric energy change   =',dtmoist_min*ptimestep,'K/step'
                      endif
-                     
+
                      call planetwide_sumval(massarea(:,:)*dqmoist(:,:,igcm_h2o_vap)*ptimestep/totarea_planet+        &
                                             massarea(:,:)*dqmoist(:,:,igcm_h2o_ice)*ptimestep/totarea_planet,dWtot)
                      if (is_master) print*,'In moistadj atmospheric water change    =',dWtot,' kg m-2'
-                     
+
                   endif ! end of 'enertest'
                else
@@ -1497,5 +1497,5 @@
                   dqmoist(:,:,:)=0
                endif ! end of '(.not.calltherm).and.moistadjustment'
-               
+
                ! Large scale condensation/evaporation.
                ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1519,5 +1519,5 @@
                   call planetwide_sumval(massarea(:,:)*dqvaplscale(:,:)*ptimestep/totarea_planet+        &
                                            SUM(massarea(:,:)*dqcldlscale(:,:))*ptimestep/totarea_planet,dWtot)
-                        
+
                   if (is_master) print*,'In largescale atmospheric water change  =',dWtot,' kg m-2'
                endif ! end of 'enertest'
@@ -1526,13 +1526,13 @@
                do l = 1, nlayer
                   do ig=1,ngrid
-                     cloudfrac(ig,l)=MAX(rneb_lsc(ig,l),rneb_man(ig,l)) 
+                     cloudfrac(ig,l)=MAX(rneb_lsc(ig,l),rneb_man(ig,l))
                   enddo
                enddo
 
             endif ! end of 'watercond'
-           
+
             ! Water ice / liquid precipitation.
             ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-            zdqrain(1:ngrid,1:nlayer,1:nq) = 0.0  !JL18 need to do that everytimestep if mass redis is on. 
+            zdqrain(1:ngrid,1:nlayer,1:nq) = 0.0  !JL18 need to do that everytimestep if mass redis is on.
 
             if(waterrain)then
@@ -1549,14 +1549,14 @@
                                                   + zdqrain(1:ngrid,1:nlayer,igcm_h2o_ice)
                pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+zdtrain(1:ngrid,1:nlayer)
-               
+
                dqsurf(1:ngrid,igcm_h2o_vap) = dqsurf(1:ngrid,igcm_h2o_vap)+zdqsrain(1:ngrid)
-               dqsurf(1:ngrid,igcm_h2o_ice) = dqsurf(1:ngrid,igcm_h2o_ice)+zdqssnow(1:ngrid) 
-               
+               dqsurf(1:ngrid,igcm_h2o_ice) = dqsurf(1:ngrid,igcm_h2o_ice)+zdqssnow(1:ngrid)
+
 !!               call writediagfi(ngrid,"rain_post_dqsurf"," "," ",2,dqsurf(1:ngrid,igcm_h2o_vap))
 !!               call writediagfi(ngrid,"rain_post_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap))
-                
+
                ! Test energy conservation.
                if(enertest)then
-               
+
                   call planetwide_sumval(cpp*massarea(:,:)*zdtrain(:,:)/totarea_planet,dEtot)
                   if (is_master) print*,'In rain atmospheric T energy change       =',dEtot,' W m-2'
@@ -1568,5 +1568,5 @@
                   dVtot = dVtot + dVtot_tmp
                   dEtot = dItot + dVtot
-                  
+
                   if (is_master) then
                      print*,'In rain dItot =',dItot,' W m-2'
@@ -1579,5 +1579,5 @@
                           massarea(:,:)*zdqrain(:,:,igcm_h2o_ice)*ptimestep/totarea_planet,dWtot)
                   call planetwide_sumval((zdqsrain(:)+zdqssnow(:))*cell_area(:)*ptimestep/totarea_planet,dWtots)
-                  
+
                   if (is_master) then
                           print*,'In rain atmospheric water change        =',dWtot,' kg m-2'
@@ -1585,9 +1585,9 @@
                           print*,'In rain non-cons factor                 =',dWtot+dWtots,' kg m-2'
                   endif
-                  
+
                endif ! end of 'enertest'
 
             end if ! enf of 'waterrain'
-            
+
          end if ! end of 'water'
 
@@ -1648,5 +1648,5 @@
 
          !Generic Condensation
-         if (generic_condensation) then 
+         if (generic_condensation) then
             call condensation_generic(ngrid,nlayer,nq,ptimestep,pplev,pplay,   &
                                           pt,pq,pdt,pdq,dt_generic_condensation, &
@@ -1666,5 +1666,5 @@
             end if
 
-            if (.not. water) then 
+            if (.not. water) then
                ! Compute GCS (Generic Condensable Specie) cloud fraction. For now we can not have both water cloud fraction and GCS cloud fraction
                ! Water is the priority
@@ -1688,5 +1688,5 @@
                      enddo
                   endif
-            end do ! do iq=1,nq loop on tracers 
+            end do ! do iq=1,nq loop on tracers
             endif ! .not. water
 
@@ -1712,5 +1712,5 @@
 
             pdt(1:ngrid,1:nlayer) = pdt(1:ngrid,1:nlayer)+zdtrain_generic(1:ngrid,1:nlayer)
-            
+
             dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq)+zdqsrain_generic(1:ngrid,1:nq)
 
@@ -1719,5 +1719,5 @@
             ! Test energy conservation.
             if(enertest)then
-               
+
                call planetwide_sumval(cpp*massarea(:,:)*zdtrain_generic(:,:)/totarea_planet,dEtot)
                if (is_master) print*,'In rain_generic atmospheric T energy change       =',dEtot,' W m-2'
@@ -1730,5 +1730,5 @@
 
                   call generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
-                  
+
                   if (call_ice_vap_generic) then ! to call only one time the ice/vap pair of a tracer
 
@@ -1740,5 +1740,5 @@
                      dVtot = dVtot + dVtot_tmp
                      dEtot = dItot + dVtot
-                     
+
                      if (is_master) then
                         print*,'In rain_generic dItot =',dItot,' W m-2'
@@ -1750,5 +1750,5 @@
                            massarea(:,:)*dq_rain_generic_cld(:,:,igcm_generic_ice)*ptimestep/totarea_planet,dWtot)
                      call planetwide_sumval((zdqsrain_generic(:,igcm_generic_ice)+zdqssnow_generic(:,igcm_generic_ice))*cell_area(:)*ptimestep/totarea_planet,dWtots)
-                     
+
                      if (is_master) then
                            print*,'In rain_generic atmospheric generic tracer change        =',dWtot,' kg m-2'
@@ -1759,8 +1759,8 @@
                   endif
 
-               end do ! do iq=1,nq loop on tracers 
-               
+               end do ! do iq=1,nq loop on tracers
+
             endif ! end of 'enertest'
-         
+
          endif !generic_rain
 
@@ -1772,5 +1772,5 @@
 
             if(watertest)then
-           
+
                iq=igcm_h2o_ice
                call planetwide_sumval(massarea(:,:)*pq(:,:,iq)*ptimestep/totarea_planet,dWtot)
@@ -1781,5 +1781,5 @@
                endif
             endif
-           
+
             call callsedim(ngrid,nlayer,ptimestep,           &
                           pplev,zzlev,pt,pdt,pq,pdq,        &
@@ -1834,5 +1834,5 @@
                zdmassmr_col(ig)=SUM(zdmassmr(ig,1:nlayer))
             enddo
-            
+
             call writediagfi(ngrid,"mass_evap","mass gain"," ",3,zdmassmr)
             call writediagfi(ngrid,"mass_evap_col","mass gain col"," ",2,zdmassmr_col)
@@ -1843,5 +1843,5 @@
                                      pu,pv,pdt,zdtsurf,pdq,pdu,pdv,zdmassmr,        &
                                      zdtmr,zdtsurfmr,zdpsrfmr,zdumr,zdvmr,zdqmr,zdqsurfmr)
-         
+
             pdq(1:ngrid,1:nlayer,1:nq) = pdq(1:ngrid,1:nlayer,1:nq) + zdqmr(1:ngrid,1:nlayer,1:nq)
             dqsurf(1:ngrid,1:nq)       = dqsurf(1:ngrid,1:nq) + zdqsurfmr(1:ngrid,1:nq)
@@ -1851,5 +1851,5 @@
             pdpsrf(1:ngrid)            = pdpsrf(1:ngrid) + zdpsrfmr(1:ngrid)
             zdtsurf(1:ngrid)           = zdtsurf(1:ngrid) + zdtsurfmr(1:ngrid)
-            
+
          endif
 
@@ -1881,5 +1881,5 @@
 !!                                     flux_g, dt_hdiff, &
 !!                                     dt_ekman)
-            
+
             call ocean_slab_noice(icount, ptimestep, knon, knindex, &
                       zdqssnow, tsea_ice, &
@@ -1896,5 +1896,5 @@
             call ocean_slab_get_vars(ngrid, tslab, sea_ice, flux_g, &
                       dt_hdiff, dt_ekman)
-  
+
             do ig=1,ngrid
                if (nint(rnat(ig)).eq.1)then
@@ -1919,5 +1919,5 @@
 
          if(hydrology)then
-            
+
             call hydrol(ngrid,nq,ptimestep,rnat,tsurf,qsurf,dqsurf,dqs_hyd, &
                         capcal,albedo,albedo_bareground,                    &
@@ -1925,5 +1925,5 @@
                         mu0,zdtsurf,zdtsurf_hyd,hice,pctsrf_sic,            &
                         sea_ice)
-                
+
 !!            call writediagfi(ngrid,"hydrol_post0_qsurf"," "," ",2,qsurf(1:ngrid,igcm_h2o_vap))
 
@@ -1931,5 +1931,5 @@
             dqsurf(1:ngrid,1:nq) = dqsurf(1:ngrid,1:nq) + dqs_hyd(1:ngrid,1:nq)
 
-            
+
             qsurf(1:ngrid,1:nq) = qsurf(1:ngrid,1:nq) + ptimestep*dqsurf(1:ngrid,1:nq)
 
@@ -1960,5 +1960,5 @@
          end if ! of if (hydrology)
 
-         ! Add qsurf to qsurf_hist, which is what we save in diagfi.nc. At the same time, we set the water 
+         ! Add qsurf to qsurf_hist, which is what we save in diagfi.nc. At the same time, we set the water
          ! content of ocean gridpoints back to zero, in order to avoid rounding errors in vdifc, rain.
          qsurf_hist(:,:) = qsurf(:,:)
@@ -1968,5 +1968,5 @@
 
 !------------------------------------------------
-!   VII. Surface and sub-surface soil temperature 
+!   VII. Surface and sub-surface soil temperature
 !------------------------------------------------
 
@@ -1981,7 +1981,7 @@
            tsurf(ig)=tsurf(ig)+ptimestep*zdtsurf(ig)
          enddo
-   
+
       else
-        tsurf(1:ngrid)=tsurf(1:ngrid)+ptimestep*zdtsurf(1:ngrid) 
+        tsurf(1:ngrid)=tsurf(1:ngrid)+ptimestep*zdtsurf(1:ngrid)
       endif ! end of 'ok_slab_ocean'
 
@@ -1990,12 +1990,12 @@
       if (callsoil) then
          call soil(ngrid,nsoilmx,.false.,lastcall,inertiedat,   &
-                   ptimestep,tsurf,tsoil,capcal,fluxgrd)     
+                   ptimestep,tsurf,tsoil,capcal,fluxgrd)
       endif
 
 
       if (ok_slab_ocean) then
-      
+
          do ig=1,ngrid
-         
+
             fluxgrdocean(ig)=fluxgrd(ig)
             if (nint(rnat(ig)).eq.0) then
@@ -2013,9 +2013,9 @@
                      capcal(ig)=capcalsno
                   endif
-               endif               
+               endif
             endif
-            
+
          enddo
-         
+
       endif !end of 'ok_slab_ocean'
 
@@ -2023,5 +2023,5 @@
       ! Test energy conservation
       if(enertest)then
-         call planetwide_sumval(cell_area(:)*capcal(:)*zdtsurf(:)/totarea_planet,dEtots)         
+         call planetwide_sumval(cell_area(:)*capcal(:)*zdtsurf(:)/totarea_planet,dEtots)
          if (is_master) print*,'Surface energy change                 =',dEtots,' W m-2'
       endif
@@ -2035,10 +2035,10 @@
 
 
- 
+
       ! Temperature, zonal and meridional winds.
       zt(1:ngrid,1:nlayer) = pt(1:ngrid,1:nlayer) + pdt(1:ngrid,1:nlayer)*ptimestep
       zu(1:ngrid,1:nlayer) = pu(1:ngrid,1:nlayer) + pdu(1:ngrid,1:nlayer)*ptimestep
       zv(1:ngrid,1:nlayer) = pv(1:ngrid,1:nlayer) + pdv(1:ngrid,1:nlayer)*ptimestep
-      
+
       ! Recast thermal plume vertical velocity array for outputs
       IF (calltherm) THEN
@@ -2113,9 +2113,9 @@
             endif
          end do
-                     
+
          if(ngrid.eq.1)then
             DYN=0.0
          endif
-         
+
          if (is_master) then
             print*,'  ISR            ASR            OLR            GND            DYN [W m^-2]'
@@ -2199,5 +2199,5 @@
 
          h2otot = icesrf + liqsrf + icecol + vapcol
-         
+
          if (is_master) then
             print*,' Total water amount [kg m^-2]: ',h2otot
@@ -2220,5 +2220,5 @@
       ! Calculate RH (Relative Humidity) for diagnostic.
       if(water)then
-      
+
          do l = 1, nlayer
             do ig=1,ngrid
@@ -2241,7 +2241,7 @@
 
             call generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
-            
+
             if (call_ice_vap_generic) then ! to call only one time the ice/vap pair of a tracer
-      
+
                do l = 1, nlayer
                   do ig=1,ngrid
@@ -2252,5 +2252,5 @@
 
             end if
-         
+
          end do ! iq=1,nq
 
@@ -2259,6 +2259,6 @@
 
       if (is_master) print*,'--> Ls =',zls*180./pi
-      
-      
+
+
 !----------------------------------------------------------------------
 !        Writing NetCDF file  "RESTARTFI" at the end of the run
@@ -2277,8 +2277,8 @@
 
 #ifndef MESOSCALE
-         
+
          if (ngrid.ne.1) then
             write(*,*)'PHYSIQ: for physdem ztime_fin =',ztime_fin
-            
+
             call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq, &
                           ptimestep,ztime_fin,                    &
@@ -2301,5 +2301,5 @@
 !  which can later be used to make the statistic files of the run:
 !  if flag "callstats" from callphys.def is .true.)
-         
+
 
          call wstats(ngrid,"ps","Surface pressure","Pa",2,ps)
@@ -2311,8 +2311,8 @@
                      "Thermal IR radiative flux to space","W.m-2",2,    &
                      fluxtop_lw)
-                     
+
 !            call wstats(ngrid,"fluxsurf_sw",                               &
 !                        "Solar radiative flux to surface","W.m-2",2,       &
-!                         fluxsurf_sw_tot)                     
+!                         fluxsurf_sw_tot)
 !            call wstats(ngrid,"fluxtop_sw",                                &
 !                        "Solar radiative flux to space","W.m-2",2,         &
@@ -2335,23 +2335,23 @@
             do iq=1,nq
                call wstats(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))
-               call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  & 
+               call wstats(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  &
                            'kg m^-2',2,qsurf(1,iq) )
-               call wstats(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',    & 
+               call wstats(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',    &
                           'kg m^-2',2,qcol(1,iq) )
-                          
-!              call wstats(ngrid,trim(noms(iq))//'_reff',                          & 
-!                          trim(noms(iq))//'_reff',                                   & 
+
+!              call wstats(ngrid,trim(noms(iq))//'_reff',                          &
+!                          trim(noms(iq))//'_reff',                                   &
 !                          'm',3,reffrad(1,1,iq))
 
             end do
-            
+
             if (water) then
                vmr=zq(1:ngrid,1:nlayer,igcm_h2o_vap)*mugaz/mmol(igcm_h2o_vap)
                call wstats(ngrid,"vmr_h2ovapor",                             &
-                           "H2O vapour volume mixing ratio","mol/mol",       & 
+                           "H2O vapour volume mixing ratio","mol/mol",       &
                            3,vmr)
             endif
 
-         endif ! end of 'tracer' 
+         endif ! end of 'tracer'
 
          if(watercond.and.CLFvarying)then
@@ -2381,8 +2381,8 @@
             call mkstats(ierr)
          endif
-         
+
 
 #ifndef MESOSCALE
-       
+
 !-----------------------------------------------------------------------------------------------------
 !           OUTPUT in netcdf file "DIAGFI.NC", containing any variable for diagnostic
@@ -2427,5 +2427,5 @@
          call writediagfi(ngrid,"latentFlux","latent heat flux","w.m^-2",2,zdqsdif(:,igcm_h2o_vap)*RLVTT)
       endif
-      
+
       ! Thermal plume model
       if (calltherm) then
@@ -2442,8 +2442,8 @@
          call WRITEDIAGFI(ngrid,"dvgwno","GW non-oro dV","m/s2", 3,d_v_hin)
       endif
-      
+
       ! Total energy balance diagnostics
       if(callrad.and.(.not.newtonian))then
-      
+
          !call writediagfi(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)
          !call writediagfi(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
@@ -2452,5 +2452,5 @@
          call writediagfi(ngrid,"OLR","outgoing longwave rad.","W m-2",2,fluxtop_lw)
          call writediagfi(ngrid,"shad","rings"," ", 2, fract)
-         
+
 !           call writediagfi(ngrid,"ASRcs","absorbed stellar rad (cs).","W m-2",2,fluxabs_sw1)
 !           call writediagfi(ngrid,"OLRcs","outgoing longwave rad (cs).","W m-2",2,fluxtop_lw1)
@@ -2465,37 +2465,37 @@
             call writediagfi(ngrid,"GND","heat flux from ground","W m-2",2,fluxgrd)
          endif
-         
+
          call writediagfi(ngrid,"DYN","dynamical heat input","W m-2",2,fluxdyn)
-         
+
       endif ! end of 'callrad'
-        
+
       if(enertest) then
-      
+
          if (calldifv) then
-         
+
             call writediagfi(ngrid,"q2","turbulent kinetic energy","J.kg^-1",3,q2)
             call writediagfi(ngrid,"sensibFlux","sensible heat flux","w.m^-2",2,sensibFlux)
-            
+
 !             call writediagfi(ngrid,"dEzdiff","turbulent diffusion heating (-sensible flux)","w.m^-2",3,dEzdiff)
 !             call writediagfi(ngrid,"dEdiff","integrated turbulent diffusion heating (-sensible flux)","w.m^-2",2,dEdiff)
 !             call writediagfi(ngrid,"dEdiffs","In TurbDiff (correc rad+latent heat) surf nrj change","w.m^-2",2,dEdiffs)
-             
-         endif
-          
+
+         endif
+
          if (corrk) then
             call writediagfi(ngrid,"dEzradsw","radiative heating","w.m^-2",3,dEzradsw)
             call writediagfi(ngrid,"dEzradlw","radiative heating","w.m^-2",3,dEzradlw)
          endif
-          
+
          if(watercond) then
 
-            call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE) 
+            call writediagfi(ngrid,"lscaledE","heat from largescale","W m-2",2,lscaledE)
             if ((.not.calltherm).and.moistadjustment) then
                call writediagfi(ngrid,"madjdE","heat from moistadj","W m-2",2,madjdE)
             endif
             call writediagfi(ngrid,"qsatatm","atm qsat"," ",3,qsat)
-             
-!             call writediagfi(ngrid,"lscaledEz","heat from largescale","W m-2",3,lscaledEz) 
-!             call writediagfi(ngrid,"madjdEz","heat from moistadj","W m-2",3,madjdEz)             
+
+!             call writediagfi(ngrid,"lscaledEz","heat from largescale","W m-2",3,lscaledEz)
+!             call writediagfi(ngrid,"madjdEz","heat from moistadj","W m-2",3,madjdEz)
 !             call writediagfi(ngrid,"h2o_max_col","maximum H2O column amount","kg.m^-2",2,H2Omaxcol)
 
@@ -2506,12 +2506,12 @@
             call writediagfi(ngrid,"genericconddE","heat from generic condensation","W m-2",2,genericconddE)
             call writediagfi(ngrid,"dt_generic_condensation","heating from generic condensation","K s-1",3,dt_generic_condensation)
-         
-         endif
-          
+
+         endif
+
       endif ! end of 'enertest'
 
         ! Diagnostics of optical thickness
         ! Warning this is exp(-tau), I let you postproc with -log to have tau itself - JVO 19
-        if (diagdtau) then                
+        if (diagdtau) then
           do nw=1,L_NSPECTV
             write(str2,'(i2.2)') nw
@@ -2530,9 +2530,9 @@
         call writediagfi(ngrid,"dtrad","radiative heating","K s-1",3,dtrad)
         call writediagfi(ngrid,"zdtdyn","Dyn. heating","T s-1",3,zdtdyn)
-        
+
         ! For Debugging.
         !call writediagfi(ngrid,'rnat','Terrain type',' ',2,real(rnat))
         !call writediagfi(ngrid,'pphi','Geopotential',' ',3,pphi)
-        
+
 
       ! Output aerosols.
@@ -2548,13 +2548,13 @@
       ! Output tracers.
       if (tracer) then
-      
+
          do iq=1,nq
             call writediagfi(ngrid,noms(iq),noms(iq),'kg/kg',3,zq(1,1,iq))
-            call writediagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  & 
+            call writediagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  &
                              'kg m^-2',2,qsurf_hist(1,iq) )
-            call writediagfi(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',    & 
+            call writediagfi(ngrid,trim(noms(iq))//'_col',trim(noms(iq))//'_col',    &
                             'kg m^-2',2,qcol(1,iq) )
-!          call writediagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  & 
-!                          'kg m^-2',2,qsurf(1,iq) )                          
+!          call writediagfi(ngrid,trim(noms(iq))//'_surf',trim(noms(iq))//'_surf',  &
+!                          'kg m^-2',2,qsurf(1,iq) )
 
             if(watercond.or.CLFvarying)then
@@ -2591,10 +2591,10 @@
 
          enddo ! end of 'nq' loop
-         
+
        endif ! end of 'tracer'
 
 
       ! Output spectrum.
-      if(specOLR.and.corrk)then      
+      if(specOLR.and.corrk)then
          call writediagspecIR(ngrid,"OLR3D","OLR(lon,lat,band)","W/m^2/cm^-1",3,OLR_nu)
          call writediagspecVI(ngrid,"OSR3D","OSR(lon,lat,band)","W/m^2/cm^-1",3,OSR_nu)
@@ -2628,5 +2628,5 @@
       do iq=1,nq
          call generic_tracer_index(nq,iq,igcm_generic_vap,igcm_generic_ice,call_ice_vap_generic)
-                  
+
          if (call_ice_vap_generic) then ! to call only one time the ice/vap pair of a tracer
 
@@ -2645,6 +2645,6 @@
             comm_RH(1:ngrid,1:nlayer) = RH_generic(1:ngrid,1:nlayer,iq)
 
-         endif 
-      end do ! do iq=1,nq loop on tracers 
+         endif
+      end do ! do iq=1,nq loop on tracers
 
    else
@@ -2689,9 +2689,9 @@
 
 ! XIOS outputs
-#ifdef CPP_XIOS      
+#ifdef CPP_XIOS
       ! Send fields to XIOS: (NB these fields must also be defined as
       ! <field id="..." /> in context_lmdz_physics.xml to be correctly used)
       CALL send_xios_field("ls",zls)
-      
+
       CALL send_xios_field("ps",ps)
       CALL send_xios_field("area",cell_area)
@@ -2701,5 +2701,5 @@
       CALL send_xios_field("v",zv)
       CALL send_xios_field("omega",omega)
-      
+
       IF (calltherm) THEN
          CALL send_xios_field('w_plm',zw2_bis)
@@ -2709,5 +2709,5 @@
 !         CALL send_xios_field('fraca',fraca)
       ENDIF
-      
+
       IF (water) THEN
          CALL send_xios_field('h2o_vap',zq(:,:,igcm_h2o_vap))
@@ -2725,5 +2725,5 @@
       CALL send_xios_field("ASR",fluxabs_sw)
 
-      if (specOLR .and. corrk) then 
+      if (specOLR .and. corrk) then
          call send_xios_field("OLR3D",OLR_nu)
          call send_xios_field("IR_Bandwidth",DWNI)
@@ -2738,5 +2738,5 @@
       endif
 #endif
-      
+
       if (check_physics_outputs) then
          ! Check the validity of updated fields at the end of the physics step
@@ -2745,6 +2745,6 @@
 
       icount=icount+1
-      
+
       end subroutine physiq
-      
+
    end module physiq_mod
Index: /trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90	(revision 3231)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/condense_n2.F90	(revision 3232)
@@ -495,4 +495,23 @@
           end do
 
+!             Value transfert at the surface interface when condensation sublimation:
+
+          if (zmflux(1).lt.0) then
+!               Surface condensation
+            zum(1)= zu(1)
+            zvm(1)= zv(1)
+            ztm(1) = ztc(1)
+          else
+!               Surface sublimation:
+            ztm(1) = ztsrf(ig) + pdtsrfc(ig)*ptimestep
+            zum(1) = 0
+            zvm(1) = 0
+          end if
+          do iq=1,nq
+              zqm(1,iq)=0. ! most tracer do not condense !
+          enddo
+!             Special case if the tracer is n2 gas
+          if (igcm_n2.ne.0) zqm(1,igcm_n2)=1.
+
            ztm(2:klev+1)=0.
            zum(2:klev+1)=0.
@@ -528,22 +547,4 @@
            end if
 
-!             Value transfert at the surface interface when condensation sublimation:
-
-          if (zmflux(1).lt.0) then
-!               Surface condensation
-            zum(1)= zu(1)
-            zvm(1)= zv(1)
-            ztm(1) = ztc(1)
-          else
-!               Surface sublimation:
-            ztm(1) = ztsrf(ig) + pdtsrfc(ig)*ptimestep
-            zum(1) = 0
-            zvm(1) = 0
-          end if
-          do iq=1,nq
-             zqm(1,iq)=0. ! most tracer do not condense !
-          enddo
-!             Special case if the tracer is n2 gas
-          if (igcm_n2.ne.0) zqm(1,igcm_n2)=1.
 
           !!! Source haze: 0.02 pourcent when n2 sublimes
Index: unk/LMDZ.PLUTO/libf/phypluto/dyn1d/calcenergy_kcm.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/calcenergy_kcm.F90	(revision 3231)
+++ 	(revision )
@@ -1,75 +1,0 @@
-subroutine calcenergy_kcm(nlayer,Tsurf,T,Play,Plev,Qsurf,Q,muvar,Eatmtot)
-
-
-use params_h, only : Rc
-use watercommon_h, only : mH2O
-use comcstfi_mod, only: g, mugaz
-implicit none
-
-!     ----------------------------------------------------------------
-!     Purpose: Calculate total energy of the (steam) atmosphere
-!     Authour: R. Wordsworth (2011)
-!     ----------------------------------------------------------------
-
-
-  ! inputs
-  integer,intent(in) :: nlayer
-  real Tsurf,T(1:nlayer)
-  real Play(1:nlayer),Plev(1:nlayer+1)
-  real Qsurf,Q(1:nlayer)
-  real muvar(1,nlayer+1)
-
-  ! internal
-  integer il
-  real m_n,m_v,cp_n,cp_v,cp_a,Eatmlay
-  real s_c,rho_v,L
-  double precision p_v, s_v, nul
-  real VMR(1:nlayer)
-
-  ! output
-  real Eatmtot
-
-  ! functions
-  double precision cp_neutral
-
-  m_n = mugaz/1000.
-  m_v = mH2O/1000.
-
-
-  do il=1,nlayer
-     VMR(il)=Q(il)*(muvar(1,il+1)/mH2O)
-  end do
-
-
-  Eatmtot = 0.0
-  do il=1,nlayer
-
-
-     cp_n = cp_neutral(dble(T(il)))
-     cp_v = (32.24+1.923d-3*T(il) + 1.055d-5*T(il)**2-3.511d-9*T(il)**3)/m_v
-     ! / by m_v makes it per kg not per mol
-
-     call psat_H2O(dble(T(il)),p_v)
-     p_v   = p_v*1d6
-     rho_v = real(p_v)*m_v/(real(Rc)*T(il))
-
-     call therm(dble(T(il)),dble(rho_v)*1d-3,nul,nul,nul,nul,nul,nul,nul,&
-                nul,nul,nul,s_v,nul)
-
-     s_c = 2.06 * log(T(il)/273.15)
-     s_v = s_v * 1d3
-     s_c = s_c * 1d3
-     L   = (real(s_v)-s_c)*T(il)
-
-     cp_a    = (1-VMR(il))*cp_n + VMR(il)*cp_v 
-     !cp_a    = (1-Q(il))*cp_n + Q(il)*cp_v 
-
-     Eatmlay = ( cp_a*T(il) + L*VMR(il) ) * (Plev(il)-Plev(il+1))/g
-
-     Eatmtot = Eatmtot + Eatmlay 
-  enddo
-
-  print*,'WARNING: E-calc currently assumes H2O saturation!'
-
-end subroutine calcenergy_kcm
-
Index: /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/kcmprof_fn.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/kcmprof_fn.F90	(revision 3231)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/kcmprof_fn.F90	(revision 3232)
@@ -2,8 +2,7 @@
 
 use params_h
-use watercommon_h, only : mH2O
 use gases_h
 use comcstfi_mod, only: mugaz, cpp, g
-use callkeys_mod, only: co2cond
+use callkeys_mod, only: n2cond
 implicit none
 
@@ -97,7 +96,7 @@
      m_v   = 1.0
      tcrit = 1000.0
-  elseif(trim(gnom(vgas)).eq.'H2O')then
-     m_v   = dble(mH2O/1000.)
-     tcrit = 6.47d2
+!   elseif(trim(gnom(vgas)).eq.'H2O')then
+   !   m_v   = dble(mH2O/1000.) ! AF24: no water in Pluton
+   !   tcrit = 6.47d2
   elseif(trim(gnom(vgas)).eq.'NH3')then
      m_v   = 17.031/1000.
@@ -368,22 +367,4 @@
   enddo
 
-!    CO2 condensation 'haircut' of temperature profile if necessary
-  if(co2cond)then
-     print*,'CO2 condensation haircut - assumes CO2-dominated atmosphere!'
-     do ilay=2,nlayer
-        if(P_rcm(ilay).lt.518000.)then
-           TCO2cond = (-3167.8)/(log(.01*P_rcm(ilay))-23.23) ! Fanale's formula
-        else
-           TCO2cond = 684.2-92.3*log(P_rcm(ilay))+4.32*log(P_rcm(ilay))**2 
-           ! liquid-vapour transition (based on CRC handbook 2003 data)
-        endif
-
-        print*,'p=',P_rcm(ilay),', T=',T_rcm(ilay),' Tcond=',TCO2cond
-        if(T_rcm(ilay).lt.TCO2cond)then
-           T_rcm(ilay)=TCO2cond
-        endif
-     enddo
-  endif
-
   return
 end subroutine kcmprof_fn
Index: /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/rcm1d.F
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/rcm1d.F	(revision 3231)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/dyn1d/rcm1d.F	(revision 3232)
@@ -89,6 +89,6 @@
       REAL,ALLOCATABLE :: qsurf(:)    ! tracer surface budget (e.g. kg.m-2)
       REAL,ALLOCATABLE :: tsoil(:)    ! subsurface soil temperature (K)
-!      REAL co2ice               ! co2ice layer (kg.m-2) !not used anymore
-      integer :: i_co2_ice=0     ! tracer index of co2 ice
+!      REAL n2ice               ! n2ice layer (kg.m-2) !not used anymore
+      integer :: i_n2_ice=0     ! tracer index of n2 ice
       integer :: i_h2o_ice=0     ! tracer index of h2o ice
       integer :: i_h2o_vap=0     ! tracer index of h2o vapor
@@ -235,6 +235,6 @@
       emisice(2)=0.95            ! Emissivite calotte sud  
 
-      iceradius(1) = 100.e-6     ! mean scat radius of CO2 snow (north)
-      iceradius(2) = 100.e-6     ! mean scat radius of CO2 snow (south)
+      iceradius(1) = 100.e-6     ! mean scat radius of n2 snow (north)
+      iceradius(2) = 100.e-6     ! mean scat radius of n2 snow (south)
       dtemisice(1) = 2.          ! time scale for snow metamorphism (north)
       dtemisice(2) = 2.          ! time scale for snow metamorphism (south
@@ -313,11 +313,11 @@
             endif
           enddo !of do iq=1,nq
-! check for co2_ice / h2o_ice tracers:
-         i_co2_ice=0
+! check for n2_ice / h2o_ice tracers:
+         i_n2_ice=0
          i_h2o_ice=0
          i_h2o_vap=0
          do iq=1,nq
-           if (tname(iq)=="co2_ice") then
-             i_co2_ice=iq
+           if (tname(iq)=="n2") then
+             i_n2_ice=iq
            elseif (tname(iq)=="h2o_ice") then
              i_h2o_ice=iq
@@ -390,5 +390,5 @@
       call getin("rad",rad)
       ! Planetary  radius is needed to compute shadow of the rings
-      IF (rad.eq.-99999. .and. rings_shadow .eqv. .true.) THEN
+      IF (rad.eq.-99999.) THEN
           PRINT *,"STOP. I NEED rad IN RCM1D.DEF."
           STOP
@@ -623,10 +623,10 @@
             write(*,*)"  tracer:",trim(txt)
               
-            ! CO2
-            if (txt.eq."co2_ice") then
+            ! n2
+            if (txt.eq."n2_ice") then
                q(:,iq)=0.   ! kg/kg of atmosphere
                qsurf(iq)=0. ! kg/m2 at the surface               
-               ! Look for a "profile_co2_ice" input file
-               open(91,file='profile_co2_ice',status='old',
+               ! Look for a "profile_n2_ice" input file
+               open(91,file='profile_n2_ice',status='old',
      &         form='formatted',iostat=ierr)
                if (ierr.eq.0) then
@@ -636,8 +636,8 @@
                   enddo
                else
-                  write(*,*) "No profile_co2_ice file!"
+                  write(*,*) "No profile_n2_ice file!"
                endif
                close(91)
-            endif ! of if (txt.eq."co2")
+            endif ! of if (txt.eq."n2")
           
             ! WATER VAPOUR
@@ -739,5 +739,5 @@
       ENDDO
 
-c  emissivity / surface co2 ice ( + h2o ice??)
+c  emissivity / surface n2 ice ( + h2o ice??)
 c  -------------------------------------------
       emis(1)=emissiv ! default value for emissivity
@@ -745,14 +745,14 @@
       call getin("emis",emis(1))
       write(*,*) " emis = ",emis(1)
-      emissiv=emis(1) ! we do this so that condense_co2 sets things to the right
+      emissiv=emis(1) ! we do this so that condense_n2 sets things to the right
                    ! value if there is no snow
 
-      if(i_co2_ice.gt.0)then
-         qsurf(i_co2_ice)=0 ! default value for co2ice
-         print*,'Initial CO2 ice on the surface (kg.m-2)'
-         call getin("co2ice",qsurf(i_co2_ice))
-         write(*,*) " co2ice = ",qsurf(i_co2_ice)
-         IF (qsurf(i_co2_ice).ge.1.E+0) THEN
-            ! if we have some CO2 ice on the surface, change emissivity
+      if(i_n2_ice.gt.0)then
+         qsurf(i_n2_ice)=0 ! default value for n2ice
+         print*,'Initial n2 ice on the surface (kg.m-2)'
+         call getin("n2ice",qsurf(i_n2_ice))
+         write(*,*) " n2ice = ",qsurf(i_n2_ice)
+         IF (qsurf(i_n2_ice).ge.1.E+0) THEN
+            ! if we have some n2 ice on the surface, change emissivity
             if (latitude(1).ge.0) then ! northern hemisphere
               emis(1)=emisice(1)
@@ -911,7 +911,5 @@
       call physdem1("startfi.nc",nsoilmx,1,llm,nq,
      &                dtphys,time,
-     &                tsurf,tsoil,emis,q2,qsurf,
-     &                cloudfrac,totcloudfrac,hice, 
-     &                rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
+     &                tsurf,tsoil,emis,q2,qsurf)
 
 c=======================================================================
Index: /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90	(revision 3231)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90	(revision 3232)
@@ -551,5 +551,5 @@
              tsoil(1:ngrid,isoil)=tsurf(1:ngrid)
            enddo
-           if (is_master) write(*,*) "Physiq: initializing day_ini to pdat !"
+           if (is_master) write(*,*) "Physiq: initializing day_ini to pday !"
            day_ini=pday
          endif
