Index: /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90
===================================================================
--- /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 4105)
+++ /LMDZ6/trunk/libf/phylmd/phys_output_write_mod.F90	(revision 4106)
@@ -942,8 +942,10 @@
        CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
 
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
+          ENDIF
+          CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
+       ENDIF
 
        IF (vars_defined) THEN
@@ -1012,8 +1014,10 @@
        CALL histwrite_phy(o_SWupSFCclr, zx_tmp_fi2d)
 
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
+          ENDIF
+          CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
+       ENDIF
 
        IF (vars_defined) THEN
@@ -1027,8 +1031,10 @@
        CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
 
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
-       ENDIF
-       CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
+          ENDIF
+          CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
+       ENDIF
 
        CALL histwrite_phy(o_fdiffSWdnSFC, solswfdiff)
@@ -1047,12 +1053,17 @@
        CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
 
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = lwupc0(:,klevp1)
-       ENDIF
-       CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
-       IF (vars_defined) THEN
-          zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
-       ENDIF
-       CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             zx_tmp_fi2d(:) = lwupc0(:,klevp1)
+          ENDIF
+          CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
+       ENDIF
+
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
+          ENDIF
+          CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
+       ENDIF
 
        CALL histwrite_phy(o_bils, bils)
@@ -1558,31 +1569,34 @@
 !This is warranted by treating INCA aerosols as offline aerosols
        IF (flag_aerosol.GT.0) THEN
-          CALL histwrite_phy(o_od443aer, od443aer)
-          CALL histwrite_phy(o_od550aer, od550aer)
-          CALL histwrite_phy(o_od865aer, od865aer)
-          CALL histwrite_phy(o_abs550aer, abs550aer)
-          CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
-          CALL histwrite_phy(o_sconcso4, sconcso4)
-          CALL histwrite_phy(o_sconcno3, sconcno3)
-          CALL histwrite_phy(o_sconcoa, sconcoa)
-          CALL histwrite_phy(o_sconcbc, sconcbc)
-          CALL histwrite_phy(o_sconcss, sconcss)
-          CALL histwrite_phy(o_sconcdust, sconcdust)
-          CALL histwrite_phy(o_concso4, concso4)
-          CALL histwrite_phy(o_concno3, concno3)
-          CALL histwrite_phy(o_concoa, concoa)
-          CALL histwrite_phy(o_concbc, concbc)
-          CALL histwrite_phy(o_concss, concss)
-          CALL histwrite_phy(o_concdust, concdust)
-          CALL histwrite_phy(o_loadso4, loadso4)
-          CALL histwrite_phy(o_loadoa, loadoa)
-          CALL histwrite_phy(o_loadbc, loadbc)
-          CALL histwrite_phy(o_loadss, loadss)
-          CALL histwrite_phy(o_loaddust, loaddust)
-          CALL histwrite_phy(o_loadno3, loadno3)
-          CALL histwrite_phy(o_dryod550aer, dryod550aer)
-          DO naero = 1, naero_tot-1
-             CALL histwrite_phy(o_drytausumaero(naero),drytausum_aero(:,naero))
-          END DO
+          IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+
+             CALL histwrite_phy(o_od443aer, od443aer)
+             CALL histwrite_phy(o_od550aer, od550aer)
+             CALL histwrite_phy(o_od865aer, od865aer)
+             CALL histwrite_phy(o_abs550aer, abs550aer)
+             CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
+             CALL histwrite_phy(o_sconcso4, sconcso4)
+             CALL histwrite_phy(o_sconcno3, sconcno3)
+             CALL histwrite_phy(o_sconcoa, sconcoa)
+             CALL histwrite_phy(o_sconcbc, sconcbc)
+             CALL histwrite_phy(o_sconcss, sconcss)
+             CALL histwrite_phy(o_sconcdust, sconcdust)
+             CALL histwrite_phy(o_concso4, concso4)
+             CALL histwrite_phy(o_concno3, concno3)
+             CALL histwrite_phy(o_concoa, concoa)
+             CALL histwrite_phy(o_concbc, concbc)
+             CALL histwrite_phy(o_concss, concss)
+             CALL histwrite_phy(o_concdust, concdust)
+             CALL histwrite_phy(o_loadso4, loadso4)
+             CALL histwrite_phy(o_loadoa, loadoa)
+             CALL histwrite_phy(o_loadbc, loadbc)
+             CALL histwrite_phy(o_loadss, loadss)
+             CALL histwrite_phy(o_loaddust, loaddust)
+             CALL histwrite_phy(o_loadno3, loadno3)
+             CALL histwrite_phy(o_dryod550aer, dryod550aer)
+             DO naero = 1, naero_tot-1
+                CALL histwrite_phy(o_drytausumaero(naero),drytausum_aero(:,naero))
+             END DO
+          ENDIF
        ENDIF
        !--STRAT AER
@@ -1678,8 +1692,11 @@
           CALL histwrite_phy(o_solswad0, zx_tmp_fi2d)
           
-          CALL histwrite_phy(o_toplwad, toplwad_aero)
-          CALL histwrite_phy(o_toplwad0, toplwad0_aero)
-          CALL histwrite_phy(o_sollwad, sollwad_aero)
-          CALL histwrite_phy(o_sollwad0, sollwad0_aero)
+          IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+
+             CALL histwrite_phy(o_toplwad, toplwad_aero)
+             CALL histwrite_phy(o_toplwad0, toplwad0_aero)
+             CALL histwrite_phy(o_sollwad, sollwad_aero)
+             CALL histwrite_phy(o_sollwad0, sollwad0_aero)
+          ENDIF
           !====MS forcing diagnostics
           !ym warning : topsw_aero, solsw_aero, topsw0_aero, solsw0_aero are not defined by model
@@ -1752,5 +1769,7 @@
        ! Champs 3D:
        IF (ok_ade .OR. ok_aie) then
-          CALL histwrite_phy(o_ec550aer, ec550aer)
+          IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+             CALL histwrite_phy(o_ec550aer, ec550aer)
+          ENDIF
        ENDIF
        CALL histwrite_phy(o_lwcon, flwc)
@@ -2209,10 +2228,12 @@
        CALL histwrite_phy(o_rsucs, zx_tmp_fi3d1)
 
-       IF (vars_defined) THEN
-         DO k=1, klevp1
-           zx_tmp_fi3d1(:,k)=swupc0(:,k)*swradcorr(:)
-         ENDDO
-       ENDIF
-       CALL histwrite_phy(o_rsucsaf, zx_tmp_fi3d1)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             DO k=1, klevp1
+                zx_tmp_fi3d1(:,k)=swupc0(:,k)*swradcorr(:)
+             ENDDO
+          ENDIF
+          CALL histwrite_phy(o_rsucsaf, zx_tmp_fi3d1)
+       ENDIF
 
        IF (vars_defined) THEN
@@ -2223,11 +2244,12 @@
        CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
 
-
-       IF (vars_defined) THEN
-         DO k=1, klevp1
-           zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
-         ENDDO
-       ENDIF
-       CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
+       IF ((type_trac/='inca') .OR. (config_inca=='aeNP')) THEN 
+          IF (vars_defined) THEN
+             DO k=1, klevp1
+                zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
+             ENDDO
+          ENDIF
+          CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
+       ENDIF
 
        CALL histwrite_phy(o_rlu, lwup)
