Index: LMDZ5/trunk/libf/phylmd/physiq_mod.F90
===================================================================
--- LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2613)
+++ LMDZ5/trunk/libf/phylmd/physiq_mod.F90	(revision 2614)
@@ -3172,118 +3172,4 @@
        enddo
 
-       !
-       !jq - introduce the aerosol direct and first indirect radiative forcings
-       !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
-       IF (flag_aerosol .gt. 0) THEN
-          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
-             IF (.NOT. aerosol_couple) THEN
-                !
-                CALL readaerosol_optic( &
-                     debut, new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
-                     pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                     mass_solu_aero, mass_solu_aero_pi,  &
-                     tau_aero, piz_aero, cg_aero,  &
-                     tausum_aero, tau3d_aero)
-             ENDIF
-          ELSE                       ! RRTM radiation
-             IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
-                abort_message='config_inca=aero et rrtm=1 impossible'
-                call abort_physic(modname,abort_message,1)
-             ELSE
-                !
-#ifdef CPP_RRTM
-                IF (NSW.EQ.6) THEN
-                   !--new aerosol properties
-                   !
-                   CALL readaerosol_optic_rrtm( debut, aerosol_couple, &
-                        new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
-                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                        tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
-                        tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
-                        tausum_aero, tau3d_aero)
-
-                ELSE IF (NSW.EQ.2) THEN 
-                   !--for now we use the old aerosol properties
-                   !
-                   CALL readaerosol_optic( &
-                        debut, new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
-                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
-                        mass_solu_aero, mass_solu_aero_pi,  &
-                        tau_aero, piz_aero, cg_aero,  &
-                        tausum_aero, tau3d_aero)
-                   !
-                   !--natural aerosols
-                   tau_aero_sw_rrtm(:,:,1,:)=tau_aero(:,:,3,:)
-                   piz_aero_sw_rrtm(:,:,1,:)=piz_aero(:,:,3,:)
-                   cg_aero_sw_rrtm (:,:,1,:)=cg_aero (:,:,3,:)
-                   !--all aerosols
-                   tau_aero_sw_rrtm(:,:,2,:)=tau_aero(:,:,2,:)
-                   piz_aero_sw_rrtm(:,:,2,:)=piz_aero(:,:,2,:)
-                   cg_aero_sw_rrtm (:,:,2,:)=cg_aero (:,:,2,:)
-                ELSE
-                   abort_message='Only NSW=2 or 6 are possible with ' &
-                        // 'aerosols and iflag_rrtm=1'
-                   call abort_physic(modname,abort_message,1)
-                ENDIF
-
-                !--call LW optical properties for tropospheric aerosols 
-                !--only works for INCA aerosol (aerosol_couple = TRUE)
-                CALL aeropt_lw_rrtm(aerosol_couple,paprs,tr_seri)
-                !
-#else
-                abort_message='You should compile with -rrtm if running ' &
-                     // 'with iflag_rrtm=1'
-                call abort_physic(modname,abort_message,1)
-#endif
-                !
-             ENDIF
-          ENDIF
-       ELSE
-          tausum_aero(:,:,:) = 0.
-          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
-             tau_aero(:,:,:,:) = 1.e-15
-             piz_aero(:,:,:,:) = 1.
-             cg_aero(:,:,:,:)  = 0.
-          ELSE
-             tau_aero_sw_rrtm(:,:,:,:) = 1.e-15
-             tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
-             piz_aero_sw_rrtm(:,:,:,:) = 1.0
-             cg_aero_sw_rrtm(:,:,:,:)  = 0.0
-          ENDIF
-       ENDIF
-       !
-       !--STRAT AEROSOL
-       !--updates tausum_aero,tau_aero,piz_aero,cg_aero
-       IF (flag_aerosol_strat.GT.0) THEN
-          IF (prt_level .GE.10) THEN
-             PRINT *,'appel a readaerosolstrat', mth_cur
-          ENDIF
-          IF (iflag_rrtm.EQ.0) THEN
-           IF (flag_aerosol_strat.EQ.1) THEN
-             CALL readaerosolstrato(debut)
-           ELSE
-             abort_message='flag_aerosol_strat must equal 1 for rrtm=0'
-             call abort_physic(modname,abort_message,1)
-           ENDIF
-          ELSE
-#ifdef CPP_RRTM
-            IF (flag_aerosol_strat.EQ.1) THEN
-             CALL readaerosolstrato1_rrtm(debut)
-            ELSEIF (flag_aerosol_strat.EQ.2) THEN
-             CALL stratosphere_mask(t_seri, pplay, latitude_deg)
-             CALL readaerosolstrato2_rrtm(debut)
-            ELSE
-             abort_message='flag_aerosol_strat must equal 1 or 2 for rrtm=1'
-             call abort_physic(modname,abort_message,1)
-            ENDIF
-#else
-             abort_message='You should compile with -rrtm if running ' &
-                  // 'with iflag_rrtm=1'
-             call abort_physic(modname,abort_message,1)
-#endif
-          ENDIF
-       ENDIF
-       !--fin STRAT AEROSOL
-
        !   On prend la somme des fractions nuageuses et des contenus en eau
 
@@ -3611,4 +3497,118 @@
        !enddo
        !albedo SB <<<
+
+       !
+       !jq - introduce the aerosol direct and first indirect radiative forcings
+       !jq - Johannes Quaas, 27/11/2003 (quaas@lmd.jussieu.fr)
+       IF (flag_aerosol .gt. 0) THEN
+          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
+             IF (.NOT. aerosol_couple) THEN
+                !
+                CALL readaerosol_optic( &
+                     debut, new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
+                     pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
+                     mass_solu_aero, mass_solu_aero_pi,  &
+                     tau_aero, piz_aero, cg_aero,  &
+                     tausum_aero, tau3d_aero)
+             ENDIF
+          ELSE                       ! RRTM radiation
+             IF (aerosol_couple .AND. config_inca == 'aero' ) THEN
+                abort_message='config_inca=aero et rrtm=1 impossible'
+                call abort_physic(modname,abort_message,1)
+             ELSE
+                !
+#ifdef CPP_RRTM
+                IF (NSW.EQ.6) THEN
+                   !--new aerosol properties
+                   !
+                   CALL readaerosol_optic_rrtm( debut, aerosol_couple, &
+                        new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
+                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
+                        tr_seri, mass_solu_aero, mass_solu_aero_pi,  &
+                        tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm,  &
+                        tausum_aero, tau3d_aero)
+
+                ELSE IF (NSW.EQ.2) THEN 
+                   !--for now we use the old aerosol properties
+                   !
+                   CALL readaerosol_optic( &
+                        debut, new_aod, flag_aerosol, itap, jD_cur-jD_ref, &
+                        pdtphys, pplay, paprs, t_seri, rhcl, presnivs,  &
+                        mass_solu_aero, mass_solu_aero_pi,  &
+                        tau_aero, piz_aero, cg_aero,  &
+                        tausum_aero, tau3d_aero)
+                   !
+                   !--natural aerosols
+                   tau_aero_sw_rrtm(:,:,1,:)=tau_aero(:,:,3,:)
+                   piz_aero_sw_rrtm(:,:,1,:)=piz_aero(:,:,3,:)
+                   cg_aero_sw_rrtm (:,:,1,:)=cg_aero (:,:,3,:)
+                   !--all aerosols
+                   tau_aero_sw_rrtm(:,:,2,:)=tau_aero(:,:,2,:)
+                   piz_aero_sw_rrtm(:,:,2,:)=piz_aero(:,:,2,:)
+                   cg_aero_sw_rrtm (:,:,2,:)=cg_aero (:,:,2,:)
+                ELSE
+                   abort_message='Only NSW=2 or 6 are possible with ' &
+                        // 'aerosols and iflag_rrtm=1'
+                   call abort_physic(modname,abort_message,1)
+                ENDIF
+
+                !--call LW optical properties for tropospheric aerosols 
+                !--only works for INCA aerosol (aerosol_couple = TRUE)
+                CALL aeropt_lw_rrtm(aerosol_couple,paprs,tr_seri)
+                !
+#else
+                abort_message='You should compile with -rrtm if running ' &
+                     // 'with iflag_rrtm=1'
+                call abort_physic(modname,abort_message,1)
+#endif
+                !
+             ENDIF
+          ENDIF
+       ELSE
+          tausum_aero(:,:,:) = 0.
+          IF (iflag_rrtm .EQ. 0) THEN !--old radiation
+             tau_aero(:,:,:,:) = 1.e-15
+             piz_aero(:,:,:,:) = 1.
+             cg_aero(:,:,:,:)  = 0.
+          ELSE
+             tau_aero_sw_rrtm(:,:,:,:) = 1.e-15
+             tau_aero_lw_rrtm(:,:,:,:) = 1.e-15
+             piz_aero_sw_rrtm(:,:,:,:) = 1.0
+             cg_aero_sw_rrtm(:,:,:,:)  = 0.0
+          ENDIF
+       ENDIF
+       !
+       !--STRAT AEROSOL
+       !--updates tausum_aero,tau_aero,piz_aero,cg_aero
+       IF (flag_aerosol_strat.GT.0) THEN
+          IF (prt_level .GE.10) THEN
+             PRINT *,'appel a readaerosolstrat', mth_cur
+          ENDIF
+          IF (iflag_rrtm.EQ.0) THEN
+           IF (flag_aerosol_strat.EQ.1) THEN
+             CALL readaerosolstrato(debut)
+           ELSE
+             abort_message='flag_aerosol_strat must equal 1 for rrtm=0'
+             call abort_physic(modname,abort_message,1)
+           ENDIF
+          ELSE
+#ifdef CPP_RRTM
+            IF (flag_aerosol_strat.EQ.1) THEN
+             CALL readaerosolstrato1_rrtm(debut)
+            ELSEIF (flag_aerosol_strat.EQ.2) THEN
+             CALL stratosphere_mask(t_seri, pplay, latitude_deg)
+             CALL readaerosolstrato2_rrtm(debut)
+            ELSE
+             abort_message='flag_aerosol_strat must equal 1 or 2 for rrtm=1'
+             call abort_physic(modname,abort_message,1)
+            ENDIF
+#else
+             abort_message='You should compile with -rrtm if running ' &
+                  // 'with iflag_rrtm=1'
+             call abort_physic(modname,abort_message,1)
+#endif
+          ENDIF
+       ENDIF
+       !--fin STRAT AEROSOL
 
 !--if ok_suntime_rrtm we use ancillay data for RSUN 
