Index: /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk.F90	(revision 3361)
@@ -856,5 +856,5 @@
 
       plevrad(1) = 0.
-!      plevrad(2) = 0.   !! JL18 enabling this line puts the radiative top at p=0 which was the idea before, but does not seem to perform best after all.
+      !!plevrad(2) = 0.   !! JL18 enabling this line puts the radiative top at p=0 which was the idea before, but does not seem to perform best after all.
 
       tlevrad(1) = tlevrad(2)
Index: /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/callcorrk_pluto_mod.F90	(revision 3361)
@@ -265,5 +265,7 @@
          Cmk= 0.01 * 1.0 / (g * mugaz * 1.672621e-27) ! q_main=1.0 assumed
 
-         epsi_ch4=mmol(igcm_ch4_gas)/mmol(igcm_n2)
+         if (methane) then
+           epsi_ch4=mmol(igcm_ch4_gas)/mmol(igcm_n2)
+         endif
 
          ! If fixed profile of CH4 gas
@@ -280,5 +282,4 @@
 
 !=======================================================================
-
 !     L_NSPECTV is the number of Visual(or Solar) spectral intervals
 !     how much light we get
@@ -653,4 +654,6 @@
          ELSE                          ! during the night, fluxes = 0
             nfluxtopv=0.0
+            fmnetv_nu(:,:)=0.0
+            nfluxtopv_nu(:)=0.0
             DO l=1,L_NLAYRAD
                fmnetv(l)=0.0
@@ -712,5 +715,4 @@
                end do
          END DO
-
          ! values at top of atmosphere
          dpp = g/(cpp*scalep*(plevrad(3)-plevrad(1)))
Index: /trunk/LMDZ.PLUTO/libf/phypluto/callkeys_mod.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/callkeys_mod.F90	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/callkeys_mod.F90	(revision 3361)
@@ -83,6 +83,6 @@
       logical,save :: convergeps,conservn2,condensn2,no_n2frost
 !$OMP THREADPRIVATE(convergeps,conservn2,condensn2,no_n2frost)
-      logical,save :: globmean1d,kmix_proffix
-!$OMP THREADPRIVATE(globmean1d,kmix_proffix)
+      logical,save :: kmix_proffix
+!$OMP THREADPRIVATE(kmix_proffix)
       logical,save :: ch4fix,vmrch4_proffix
 !$OMP THREADPRIVATE(ch4fix,vmrch4_proffix)
Index: /trunk/LMDZ.PLUTO/libf/phypluto/gfluxi.F
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/gfluxi.F	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/gfluxi.F	(revision 3361)
@@ -86,5 +86,5 @@
 !-----------------------------------------------------------------------
          if (W0(L).eq.1.D0) then
-            W0(L) = 0.99999D0
+               W0(L) = 0.99999D0
          endif
          
Index: /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90	(revision 3361)
@@ -981,4 +981,6 @@
                                firstcall,lastcall)
                   albedo_equivalent(1:ngrid)=albedo(1:ngrid,1)
+                  fluxrad_sky(1:ngrid)=emis(1:ngrid)*fluxsurf_lw(1:ngrid)+       &
+                               fluxsurf_sw(1:ngrid)*(1.-albedo(1:ngrid,1))
                else
                 call callcorrk(ngrid,nlayer,pq,nq,qsurf,  &
@@ -991,4 +993,8 @@
                               tau_col,cloudfrac,totcloudfrac,                     &
                               .false.,firstcall,lastcall)
+                  ! Radiative flux from the sky absorbed by the surface (W.m-2).
+                  GSR=0.0
+                  fluxrad_sky(1:ngrid)=emis(1:ngrid)*fluxsurf_lw(1:ngrid)+        &
+                              fluxsurfabs_sw(1:ngrid)
                endif ! oldplutocorrk
                 !GG (feb2021): Option to "artificially" decrease the raditive time scale in
@@ -1010,7 +1016,4 @@
                 ! AF24: removed CLFvarying Option
 
-               ! Radiative flux from the sky absorbed by the surface (W.m-2).
-               GSR=0.0
-               fluxrad_sky(1:ngrid)=emis(1:ngrid)*fluxsurf_lw(1:ngrid)+fluxsurfabs_sw(1:ngrid)
 
                             !if(noradsurf)then ! no lower surface; SW flux just disappears
@@ -2166,5 +2169,5 @@
 
          call writediagfi(ngrid,"ALB","Surface albedo"," ",2,albedo_equivalent)
-         !call writediagfi(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
+         call writediagfi(ngrid,"ALB_1st","First Band Surface albedo"," ",2,albedo(:,1))
          call writediagfi(ngrid,"ISR","incoming stellar rad.","W m-2",2,fluxtop_dn)
          call writediagfi(ngrid,"ASR","absorbed stellar rad.","W m-2",2,fluxabs_sw)
Index: /trunk/LMDZ.PLUTO/libf/phypluto/sfluxi_pluto_mod.F
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/sfluxi_pluto_mod.F	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/sfluxi_pluto_mod.F	(revision 3361)
@@ -14,5 +14,5 @@
       use radcommon_h, only: planckir, tlimit,sigma, gweight
       use comcstfi_mod, only: pi
-      use gfluxi_mod, only: gfluxi
+      use gfluxi_old_mod, only: gfluxi_old
 
 
@@ -136,5 +136,5 @@
 C         WITHIN EACH INTERVAL AT THE MIDPOINT WAVENUMBER
 
-          CALL GFLUXI(NLEVRAD,TLEV,NW,DWNI(NW),DTAUI(1,NW,NG),
+          CALL GFLUXI_OLD(NLEVRAD,TLEV,NW,DWNI(NW),DTAUI(1,NW,NG),
      *                TAUCUMI(1,NW,NG),
      *                WBARI(1,NW,NG),COSBI(1,NW,NG),UBARI,RSFI,BTOP,
@@ -193,5 +193,5 @@
 
 
-       CALL GFLUXI(NLEVRAD,TLEV,NW,DWNI(NW),DTAUI(1,NW,NG),
+       CALL GFLUXI_OLD(NLEVRAD,TLEV,NW,DWNI(NW),DTAUI(1,NW,NG),
      *                TAUCUMI(1,NW,NG),
      *                WBARI(1,NW,NG),COSBI(1,NW,NG),UBARI,RSFI,BTOP,
Index: /trunk/LMDZ.PLUTO/libf/phypluto/sfluxv_pluto_mod.F
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/sfluxv_pluto_mod.F	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/sfluxv_pluto_mod.F	(revision 3361)
@@ -12,5 +12,5 @@
       use radinc_h, only: L_NLAYRAD, L_NLEVRAD
       use radcommon_h, only: tlimit, gweight
-      use gfluxv_mod, only: gfluxv
+      use gfluxv_old_mod, only: gfluxv_old
 
       implicit none
@@ -100,5 +100,5 @@
 
 
-          CALL GFLUXV(DTAUV(1,NW,NG),TAUV(1,NW,NG),TAUCUMV(1,NW,NG),
+          CALL GFLUXV_OLD(DTAUV(1,NW,NG),TAUV(1,NW,NG),TAUCUMV(1,NW,NG),
      *                WBARV(1,NW,NG),COSBV(1,NW,NG),UBAR0,F0PI,RSFV,
      *                BTOP,BSURF,FMUPV,FMDV,DIFFV,FLUXUP,FLUXDN)
@@ -155,5 +155,5 @@
 C       RETURN FLUXES FOR A GIVEN NT
 
-        CALL GFLUXV(DTAUV(1,NW,NG),TAUV(1,NW,NG),TAUCUMV(1,NW,NG),
+        CALL GFLUXV_OLD(DTAUV(1,NW,NG),TAUV(1,NW,NG),TAUCUMV(1,NW,NG),
      *              WBARV(1,NW,NG),COSBV(1,NW,NG),UBAR0,F0PI,RSFV,
      *              BTOP,BSURF,FMUPV,FMDV,DIFFV,FLUXUP,FLUXDN)
Index: /trunk/LMDZ.PLUTO/libf/phypluto/surfprop.F90
===================================================================
--- /trunk/LMDZ.PLUTO/libf/phypluto/surfprop.F90	(revision 3360)
+++ /trunk/LMDZ.PLUTO/libf/phypluto/surfprop.F90	(revision 3361)
@@ -460,7 +460,4 @@
            enddo
         ENDDO
-        print*, emin
-        print*, tidat(1,:)
-        print*, mlayer(:)
 
       ELSE
