Ignore:
Timestamp:
Dec 6, 2022, 12:01:16 AM (18 months ago)
Author:
lguez
Message:

Sync latest trunk changes to Ocean_skin

Location:
LMDZ6/branches/Ocean_skin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/Ocean_skin

  • LMDZ6/branches/Ocean_skin/libf/phylmd/phys_output_write_mod.F90

    r4020 r4368  
    2525
    2626    USE dimphy, ONLY: klon, klev, klevp1
    27     USE infotrac_phy, ONLY: nbtr
     27    USE infotrac_phy, ONLY: nbtr, nqtot, nqo, type_trac, types_trac, tracers, niso, ntiso
     28    USE strings_mod,  ONLY: maxlen
    2829    USE mod_phys_lmdz_para, ONLY: is_north_pole_phy,is_south_pole_phy
    2930    USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat
     
    197198         o_map_emis_Anv, o_map_pcld_Anv, o_map_tcld_Anv, &
    198199         o_map_ntot, o_map_hc,o_map_hist,o_map_Cb,o_map_ThCi,o_map_Anv, &
     200#ifdef ISO
     201! Isotopes
     202         o_xtprecip,o_xtplul,o_xtpluc,o_xtovap,o_xtoliq,o_xtcond, &
     203         o_xtevap,o_dxtdyn,o_dxtldyn,o_dxtcon,o_dxtlsc,o_dxteva, &
     204         o_dxtajs,o_dxtvdf,o_dxtthe, o_dxtch4, &
     205         o_dxtprod_nucl,o_dxtcosmo,o_dxtdecroiss, &
     206#endif
     207! Tropopause
    199208         o_alt_tropo, &
    200 ! Tropopause
    201209         o_p_tropopause, o_z_tropopause, o_t_tropopause,  &
    202210         o_col_O3_strato, o_col_O3_tropo,                 &
     211!--aviation & supersaturation
     212         o_oclr, o_ocld, o_oss, o_ovc, o_rnebss, o_rnebclr, o_rnebseri, o_gammass, &
     213         o_N1_ss, o_N2_ss, o_qsatl, o_qsats, &
     214         o_drnebsub, o_drnebcon, o_drnebtur, o_drnebavi, o_flight_m, o_flight_h2o, &
     215         o_Tcontr, o_qcontr, o_qcontr2, o_fcontrN, o_fcontrP, &
    203216!--interactive CO2
    204217         o_flx_co2_ocean, o_flx_co2_ocean_cor, &
     
    222235         o_vsed_aer, o_tau_strat_1020, o_ext_strat_1020, o_f_r_wet
    223236#endif
     237
     238    USE ice_sursat_mod, ONLY: flight_m, flight_h2o
    224239   
    225240    USE phys_output_ctrlout_mod, ONLY: o_heat_volc, o_cool_volc !NL
     
    253268         rhlevSTD, O3STD, O3daySTD, uvSTD, vqSTD, vTSTD, wqSTD, vphiSTD, &
    254269         wTSTD, u2STD, v2STD, T2STD, missing_val_nf90, delta_sal, ds_ns, &
     270#ifdef ISO
     271        xtrain_con, xtsnow_con, xtrain_fall, xtsnow_fall, &
     272#endif
    255273         dt_ns, delta_sst, dter, dser
    256274
     
    269287         cldq, flwp, fiwp, ue, ve, uq, vq, &
    270288         uwat, vwat, &
     289         rneb_seri, d_rneb_dyn, &
    271290         plcl, plfc, wbeff, convoccur, upwd, dnwd, dnwd0, prw, prlw, prsw, &
    272291         s_pblh, s_pblt, s_lcl, s_therm, uwriteSTD, &
     
    282301         wdtrainA, wdtrainS, wdtrainM, n2, s2, proba_notrig, &
    283302         random_notrig, &
     303         qclr, qcld, qss, qvc, rnebclr, rnebss, gamma_ss, &
     304         N1_ss, N2_ss, zqsatl, zqsats, &
     305         Tcontr, qcontr, qcontr2, fcontrN, fcontrP, &
     306         drneb_sub, drneb_con, drneb_tur, drneb_avi, &
    284307         alp_bl_det, alp_bl_fluct_m, alp_bl_conv, &
    285308         alp_bl_stat, alp_bl_fluct_tke, slab_wfbils, &
     
    319342         east_gwstress, west_gwstress, &
    320343         d_q_ch4, pmfd, pmfu, ref_liq, ref_ice, rhwriteSTD, &
     344#ifdef ISO
     345        xtrain_lsc, xtsnow_lsc, xt_seri, xtl_seri,xts_seri,xtevap, &
     346        d_xt_dyn,d_xtl_dyn,d_xt_con,d_xt_vdf,d_xt_ajsb, &
     347        d_xt_lsc,d_xt_eva,d_xt_ch4, &
     348        d_xt_ajs, d_xt_ajsb, &
     349        d_xt_prod_nucl,d_xt_cosmo,d_xt_decroiss, &
     350#endif
    321351         ep, epmax_diag, &  ! epmax_cape
    322352         p_tropopause, t_tropopause, z_tropopause
     
    366396    USE pbl_surface_mod, ONLY: snow
    367397    USE indice_sol_mod, ONLY: nbsrf
    368     USE infotrac_phy, ONLY: nqtot, nqo, type_trac, tname, niadv
     398#ifdef ISO
     399    USE isotopes_mod, ONLY: iso_HTO
     400#endif
    369401    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
    370402    USE surface_data, ONLY: type_ocean, version_ocean, ok_veget, landice_opt
     
    394426
    395427    INCLUDE "clesphys.h"
    396     INCLUDE "thermcell.h"
     428    INCLUDE "alpale.h"
    397429    INCLUDE "compbl.h"
    398430    INCLUDE "YOMCST.h"
     
    419451    ! Local
    420452    INTEGER :: itau_w
    421     INTEGER :: i, iinit, iinitend=1, iff, iq, iiq, nsrf, k, ll, naero
     453    INTEGER :: i, iinit, iinitend=1, iff, iq, nsrf, k, ll, naero
    422454    REAL, DIMENSION (klon) :: zx_tmp_fi2d, zpt_conv2d, wind100m
    423455    REAL, DIMENSION (klon,klev) :: zx_tmp_fi3d, zpt_conv
     
    439471#endif
    440472    REAL, PARAMETER :: un_jour=86400.
    441     INTEGER ISW
     473    INTEGER :: ISW, itr, ixt, it
    442474    CHARACTER*1 ch1
    443     CHARACTER*20 varname
     475    CHARACTER(LEN=maxlen) :: varname, dn
    444476
    445477#ifdef CPP_XIOS
     
    449481#ifdef CPP_StratAer
    450482    LOGICAL, PARAMETER :: debug_strataer=.FALSE.
     483    CHARACTER(LEN=maxlen) :: unt
    451484#endif
    452485    REAL,DIMENSION(klon,klev) :: z, dz
    453486    REAL,DIMENSION(klon)      :: zrho, zt
    454 
    455     INTEGER :: nqup
    456487
    457488    ! On calcul le nouveau tau:
     
    510541          CALL xios_get_handle("fields_strataer_trac_3D", group_handle)
    511542          ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs
    512           DO iq=nqo+1, nqtot
    513             iiq=niadv(iq)
    514             varname=trim(tname(iiq))
    515             WRITE (lunout,*) 'XIOS var=', nqo, iq, nqtot, varname
     543          DO iq = 1, nqtot
     544            IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
     545            dn = 'd'//TRIM(tracers(iq)%name)//'_'
     546            WRITE (lunout,*) 'XIOS var=', nqo, iq, nqtot, tracers(iq)%name
     547
     548            unt = "kg kg-1"
     549            varname=trim(tracers(iq)%name)
    516550            CALL xios_add_child(group_handle, child, varname)
    517             CALL xios_set_attr(child, name=varname, unit="kg kg-1")
    518             varname='d'//trim(tname(iiq))//'_vdf'
     551            CALL xios_set_attr(child, name=varname, unit=unt)
     552
     553            unt = "kg kg-1 s-1"
     554            varname=TRIM(dn)//'vdf'
    519555            CALL xios_add_child(group_handle, child, varname)
    520             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    521             varname='d'//trim(tname(iiq))//'_the'
     556            CALL xios_set_attr(child, name=varname, unit=unt)
     557            varname=TRIM(dn)//'the'
    522558            CALL xios_add_child(group_handle, child, varname)
    523             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    524             varname='d'//trim(tname(iiq))//'_con'
     559            CALL xios_set_attr(child, name=varname, unit=unt)
     560            varname=TRIM(dn)//'con'
    525561            CALL xios_add_child(group_handle, child, varname)
    526             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    527             varname='d'//trim(tname(iiq))//'_lessi_impa'
     562            CALL xios_set_attr(child, name=varname, unit=unt)
     563            varname=TRIM(dn)//'lessi_impa'
    528564            CALL xios_add_child(group_handle, child, varname)
    529             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    530             varname='d'//trim(tname(iiq))//'_lessi_nucl'
     565            CALL xios_set_attr(child, name=varname, unit=unt)
     566            varname=TRIM(dn)//'lessi_nucl'
    531567            CALL xios_add_child(group_handle, child, varname)
    532             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    533             varname='d'//trim(tname(iiq))//'_insc'
     568            CALL xios_set_attr(child, name=varname, unit=unt)
     569            varname=TRIM(dn)//'insc'
    534570            CALL xios_add_child(group_handle, child, varname)
    535             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    536             varname='d'//trim(tname(iiq))//'_bcscav'
     571            CALL xios_set_attr(child, name=varname, unit=unt)
     572            varname=TRIM(dn)//'bcscav'
    537573            CALL xios_add_child(group_handle, child, varname)
    538             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    539             varname='d'//trim(tname(iiq))//'_evapls'
     574            CALL xios_set_attr(child, name=varname, unit=unt)
     575            varname=TRIM(dn)//'evapls'
    540576            CALL xios_add_child(group_handle, child, varname)
    541             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    542             varname='d'//trim(tname(iiq))//'_ls'
     577            CALL xios_set_attr(child, name=varname, unit=unt)
     578            varname=TRIM(dn)//'ls'
    543579            CALL xios_add_child(group_handle, child, varname)
    544             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    545             varname='d'//trim(tname(iiq))//'_trsp'
     580            CALL xios_set_attr(child, name=varname, unit=unt)
     581            varname=TRIM(dn)//'trsp'
    546582            CALL xios_add_child(group_handle, child, varname)
    547             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    548             varname='d'//trim(tname(iiq))//'_sscav'
     583            CALL xios_set_attr(child, name=varname, unit=unt)
     584            varname=TRIM(dn)//'sscav'
    549585            CALL xios_add_child(group_handle, child, varname)
    550             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    551             varname='d'//trim(tname(iiq))//'_sat'
     586            CALL xios_set_attr(child, name=varname, unit=unt)
     587            varname=TRIM(dn)//'sat'
    552588            CALL xios_add_child(group_handle, child, varname)
    553             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    554             varname='d'//trim(tname(iiq))//'_uscav'
     589            CALL xios_set_attr(child, name=varname, unit=unt)
     590            varname=TRIM(dn)//'uscav'
    555591            CALL xios_add_child(group_handle, child, varname)
    556             CALL xios_set_attr(child, name=varname, unit="kg kg-1 s-1")
    557           ENDDO
     592            CALL xios_set_attr(child, name=varname, unit=unt)
     593          END DO
    558594          !On ajoute les variables 2D traceurs par l interface fortran
    559595          CALL xios_get_handle("fields_strataer_trac_2D", group_handle)
    560596          ! On boucle sur les traceurs pour les ajouter au groupe puis fixer les attributs
    561           DO iq=nqo+1, nqtot
    562             iiq=niadv(iq)
    563             varname='cum'//trim(tname(iiq))
     597          DO iq = 1, nqtot
     598            IF(.NOT.(tracers(iq)%isAdvected .AND. tracers(iq)%isInPhysics)) CYCLE
     599
     600            unt = "kg m-2"
     601            varname='cum'//trim(tracers(iq)%name)
    564602            WRITE (lunout,*) 'XIOS var=', iq, nqtot, varname
    565603            CALL xios_add_child(group_handle, child, varname)
    566             CALL xios_set_attr(child, name=varname, unit="kg m-2")
    567             varname='cumd'//trim(tname(iiq))//'_dry'
     604            CALL xios_set_attr(child, name=varname, unit=unt)
     605
     606            unt = "kg m-2 s-1"
     607            varname='cumd'//trim(tracers(iq)%name)//'_dry'
    568608            CALL xios_add_child(group_handle, child, varname)
    569             CALL xios_set_attr(child, name=varname, unit="kg m-2 s-1")
     609            CALL xios_set_attr(child, name=varname, unit=unt)
    570610          ENDDO
    571611    ENDIF
     
    573613#endif
    574614#endif
     615
    575616    ! ug la boucle qui suit ne sert qu'une fois, pour l'initialisation, sinon il n'y a toujours qu'un seul passage:
    576617    DO iinit=1, iinitend
     
    902943       CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
    903944
    904        IF (vars_defined) THEN
    905           zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
    906        ENDIF
    907        CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
     945       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     946          IF (vars_defined) THEN
     947             zx_tmp_fi2d(:) = swupc0(:,klevp1)*swradcorr(:)
     948          ENDIF
     949          CALL histwrite_phy(o_SWupTOAcleanclr, zx_tmp_fi2d)
     950       ENDIF
    908951
    909952       IF (vars_defined) THEN
     
    9721015       CALL histwrite_phy(o_SWupSFCclr, zx_tmp_fi2d)
    9731016
    974        IF (vars_defined) THEN
    975           zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
    976        ENDIF
    977        CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
     1017       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1018          IF (vars_defined) THEN
     1019             zx_tmp_fi2d(:) = swupc0(:,1)*swradcorr(:)
     1020          ENDIF
     1021          CALL histwrite_phy(o_SWupSFCcleanclr, zx_tmp_fi2d)
     1022       ENDIF
    9781023
    9791024       IF (vars_defined) THEN
     
    9871032       CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
    9881033
    989        IF (vars_defined) THEN
    990           zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
    991        ENDIF
    992        CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
     1034       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1035          IF (vars_defined) THEN
     1036             zx_tmp_fi2d(:) = swdnc0(:,1)*swradcorr(:)
     1037          ENDIF
     1038          CALL histwrite_phy(o_SWdnSFCcleanclr, zx_tmp_fi2d)
     1039       ENDIF
    9931040
    9941041       CALL histwrite_phy(o_fdiffSWdnSFC, solswfdiff)
     
    10071054       CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
    10081055
    1009        IF (vars_defined) THEN
    1010           zx_tmp_fi2d(:) = lwupc0(:,klevp1)
    1011        ENDIF
    1012        CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
    1013        IF (vars_defined) THEN
    1014           zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
    1015        ENDIF
    1016        CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
     1056       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1057          IF (vars_defined) THEN
     1058             zx_tmp_fi2d(:) = lwupc0(:,klevp1)
     1059          ENDIF
     1060          CALL histwrite_phy(o_LWupTOAcleanclr, zx_tmp_fi2d)
     1061       ENDIF
     1062
     1063       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1064          IF (vars_defined) THEN
     1065             zx_tmp_fi2d(:) = -1.*lwdnc0(:,1)
     1066          ENDIF
     1067          CALL histwrite_phy(o_LWdnSFCcleanclr, zx_tmp_fi2d)
     1068       ENDIF
    10171069
    10181070       CALL histwrite_phy(o_bils, bils)
     
    12191271          IF (vars_defined) THEN
    12201272             IF (iflag_thermals>=1)THEN
    1221                 zx_tmp_fi3d=-dnwd+dnwd0+upwd+fm_therm(:,1:klev)
     1273                zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev)
    12221274             ELSE
    1223                 zx_tmp_fi3d=-dnwd+dnwd0+upwd
     1275                zx_tmp_fi3d=dnwd+dnwd0+upwd
    12241276             ENDIF
    12251277          ENDIF
     
    15181570!This is warranted by treating INCA aerosols as offline aerosols
    15191571       IF (flag_aerosol.GT.0) THEN
    1520           CALL histwrite_phy(o_od443aer, od443aer)
    1521           CALL histwrite_phy(o_od550aer, od550aer)
    1522           CALL histwrite_phy(o_od865aer, od865aer)
    1523           CALL histwrite_phy(o_abs550aer, abs550aer)
    1524           CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
    1525           CALL histwrite_phy(o_sconcso4, sconcso4)
    1526           CALL histwrite_phy(o_sconcno3, sconcno3)
    1527           CALL histwrite_phy(o_sconcoa, sconcoa)
    1528           CALL histwrite_phy(o_sconcbc, sconcbc)
    1529           CALL histwrite_phy(o_sconcss, sconcss)
    1530           CALL histwrite_phy(o_sconcdust, sconcdust)
    1531           CALL histwrite_phy(o_concso4, concso4)
    1532           CALL histwrite_phy(o_concno3, concno3)
    1533           CALL histwrite_phy(o_concoa, concoa)
    1534           CALL histwrite_phy(o_concbc, concbc)
    1535           CALL histwrite_phy(o_concss, concss)
    1536           CALL histwrite_phy(o_concdust, concdust)
    1537           CALL histwrite_phy(o_loadso4, loadso4)
    1538           CALL histwrite_phy(o_loadoa, loadoa)
    1539           CALL histwrite_phy(o_loadbc, loadbc)
    1540           CALL histwrite_phy(o_loadss, loadss)
    1541           CALL histwrite_phy(o_loaddust, loaddust)
    1542           CALL histwrite_phy(o_loadno3, loadno3)
    1543           CALL histwrite_phy(o_dryod550aer, dryod550aer)
    1544           DO naero = 1, naero_tot-1
    1545              CALL histwrite_phy(o_drytausumaero(naero),drytausum_aero(:,naero))
    1546           END DO
     1572          IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1573
     1574             CALL histwrite_phy(o_od443aer, od443aer)
     1575             CALL histwrite_phy(o_od550aer, od550aer)
     1576             CALL histwrite_phy(o_od865aer, od865aer)
     1577             CALL histwrite_phy(o_abs550aer, abs550aer)
     1578             CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
     1579             CALL histwrite_phy(o_sconcso4, sconcso4)
     1580             CALL histwrite_phy(o_sconcno3, sconcno3)
     1581             CALL histwrite_phy(o_sconcoa, sconcoa)
     1582             CALL histwrite_phy(o_sconcbc, sconcbc)
     1583             CALL histwrite_phy(o_sconcss, sconcss)
     1584             CALL histwrite_phy(o_sconcdust, sconcdust)
     1585             CALL histwrite_phy(o_concso4, concso4)
     1586             CALL histwrite_phy(o_concno3, concno3)
     1587             CALL histwrite_phy(o_concoa, concoa)
     1588             CALL histwrite_phy(o_concbc, concbc)
     1589             CALL histwrite_phy(o_concss, concss)
     1590             CALL histwrite_phy(o_concdust, concdust)
     1591             CALL histwrite_phy(o_loadso4, loadso4)
     1592             CALL histwrite_phy(o_loadoa, loadoa)
     1593             CALL histwrite_phy(o_loadbc, loadbc)
     1594             CALL histwrite_phy(o_loadss, loadss)
     1595             CALL histwrite_phy(o_loaddust, loaddust)
     1596             CALL histwrite_phy(o_loadno3, loadno3)
     1597             CALL histwrite_phy(o_dryod550aer, dryod550aer)
     1598             DO naero = 1, naero_tot-1
     1599                CALL histwrite_phy(o_drytausumaero(naero),drytausum_aero(:,naero))
     1600             END DO
     1601          ENDIF
    15471602       ENDIF
    15481603       !--STRAT AER
     
    15791634
    15801635#ifdef CPP_StratAer
    1581        IF (type_trac=='coag') THEN
     1636       IF (ANY(types_trac=='coag')) THEN
    15821637          CALL histwrite_phy(o_R2SO4, R2SO4)
    15831638          CALL histwrite_phy(o_OCS_lifetime, OCS_lifetime)
     
    16381693          CALL histwrite_phy(o_solswad0, zx_tmp_fi2d)
    16391694         
    1640           CALL histwrite_phy(o_toplwad, toplwad_aero)
    1641           CALL histwrite_phy(o_toplwad0, toplwad0_aero)
    1642           CALL histwrite_phy(o_sollwad, sollwad_aero)
    1643           CALL histwrite_phy(o_sollwad0, sollwad0_aero)
     1695          IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1696
     1697             CALL histwrite_phy(o_toplwad, toplwad_aero)
     1698             CALL histwrite_phy(o_toplwad0, toplwad0_aero)
     1699             CALL histwrite_phy(o_sollwad, sollwad_aero)
     1700             CALL histwrite_phy(o_sollwad0, sollwad0_aero)
     1701          ENDIF
    16441702          !====MS forcing diagnostics
    16451703          !ym warning : topsw_aero, solsw_aero, topsw0_aero, solsw0_aero are not defined by model
     
    17121770       ! Champs 3D:
    17131771       IF (ok_ade .OR. ok_aie) then
    1714           CALL histwrite_phy(o_ec550aer, ec550aer)
     1772          IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     1773             CALL histwrite_phy(o_ec550aer, ec550aer)
     1774          ENDIF
    17151775       ENDIF
    17161776       CALL histwrite_phy(o_lwcon, flwc)
     
    17851845       ENDIF
    17861846
     1847!--aviation & supersaturation
     1848       IF (ok_ice_sursat) THEN
     1849         CALL histwrite_phy(o_oclr, qclr)
     1850         CALL histwrite_phy(o_ocld, qcld)
     1851         CALL histwrite_phy(o_oss, qss)
     1852         CALL histwrite_phy(o_ovc, qvc)
     1853         CALL histwrite_phy(o_rnebclr, rnebclr)
     1854         CALL histwrite_phy(o_rnebss, rnebss)
     1855         CALL histwrite_phy(o_rnebseri, rneb_seri)
     1856         CALL histwrite_phy(o_gammass, gamma_ss)
     1857         CALL histwrite_phy(o_N1_ss, N1_ss)
     1858         CALL histwrite_phy(o_N2_ss, N2_ss)
     1859         CALL histwrite_phy(o_drnebsub, drneb_sub)
     1860         CALL histwrite_phy(o_drnebcon, drneb_con)
     1861         CALL histwrite_phy(o_drnebtur, drneb_tur)
     1862         CALL histwrite_phy(o_drnebavi, drneb_avi)
     1863         CALL histwrite_phy(o_qsatl, zqsatl)
     1864         CALL histwrite_phy(o_qsats, zqsats)
     1865         CALL histwrite_phy(o_Tcontr, Tcontr)
     1866         CALL histwrite_phy(o_qcontr, qcontr)
     1867         CALL histwrite_phy(o_qcontr2, qcontr2)
     1868         CALL histwrite_phy(o_fcontrN, fcontrN)
     1869         CALL histwrite_phy(o_fcontrP, fcontrP)
     1870       ENDIF
     1871       IF (ok_plane_contrail) THEN
     1872         CALL histwrite_phy(o_flight_m, flight_m)
     1873       ENDIF
     1874       IF (ok_plane_h2o) THEN
     1875         CALL histwrite_phy(o_flight_h2o, flight_h2o)
     1876       ENDIF
    17871877       
    17881878       IF (vars_defined) zx_tmp_fi3d = wo(:, :, 1) * dobson_u * 1e3 / zmasse / rmo3 * rmd
     
    21392229       CALL histwrite_phy(o_rsucs, zx_tmp_fi3d1)
    21402230
    2141        IF (vars_defined) THEN
    2142          DO k=1, klevp1
    2143            zx_tmp_fi3d1(:,k)=swupc0(:,k)*swradcorr(:)
    2144          ENDDO
    2145        ENDIF
    2146        CALL histwrite_phy(o_rsucsaf, zx_tmp_fi3d1)
     2231       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     2232          IF (vars_defined) THEN
     2233             DO k=1, klevp1
     2234                zx_tmp_fi3d1(:,k)=swupc0(:,k)*swradcorr(:)
     2235             ENDDO
     2236          ENDIF
     2237          CALL histwrite_phy(o_rsucsaf, zx_tmp_fi3d1)
     2238       ENDIF
    21472239
    21482240       IF (vars_defined) THEN
     
    21532245       CALL histwrite_phy(o_rsdcs, zx_tmp_fi3d1)
    21542246
    2155 
    2156        IF (vars_defined) THEN
    2157          DO k=1, klevp1
    2158            zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
    2159          ENDDO
    2160        ENDIF
    2161        CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
     2247       IF (ALL(types_trac/='inca') .OR. config_inca=='aeNP') THEN
     2248          IF (vars_defined) THEN
     2249             DO k=1, klevp1
     2250                zx_tmp_fi3d1(:,k)=swdnc0(:,k)*swradcorr(:)
     2251             ENDDO
     2252          ENDIF
     2253          CALL histwrite_phy(o_rsdcsaf, zx_tmp_fi3d1)
     2254       ENDIF
    21622255
    21632256       CALL histwrite_phy(o_rlu, lwup)
     
    23972490!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    23982491       IF (iflag_phytrac == 1 ) then
    2399          IF (type_trac == 'lmdz' .OR. type_trac == 'coag') THEN
    2400            DO iq=nqo+1, nqtot
     2492!
     2493         IF (ANY(types_trac == 'co2i')) THEN
     2494           itr = 0
     2495           DO iq = 1, nqtot
     2496             IF(.NOT.tracers(iq)%isInPhysics) CYCLE
     2497             itr = itr + 1
     2498!            write(*,*) 'phys_output_write_mod 2370: itr=',itr
    24012499             !--3D fields
    2402              CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
    2403              CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
    2404              CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
    2405              CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
    2406              CALL histwrite_phy(o_dtr_lessi_impa(iq-nqo),d_tr_lessi_impa(:,:,iq-nqo))
    2407              CALL histwrite_phy(o_dtr_lessi_nucl(iq-nqo),d_tr_lessi_nucl(:,:,iq-nqo))
    2408              CALL histwrite_phy(o_dtr_insc(iq-nqo),d_tr_insc(:,:,iq-nqo))
    2409              CALL histwrite_phy(o_dtr_bcscav(iq-nqo),d_tr_bcscav(:,:,iq-nqo))
    2410              CALL histwrite_phy(o_dtr_evapls(iq-nqo),d_tr_evapls(:,:,iq-nqo))
    2411              CALL histwrite_phy(o_dtr_ls(iq-nqo),d_tr_ls(:,:,iq-nqo))
    2412              CALL histwrite_phy(o_dtr_trsp(iq-nqo),d_tr_trsp(:,:,iq-nqo))
    2413              CALL histwrite_phy(o_dtr_sscav(iq-nqo),d_tr_sscav(:,:,iq-nqo))
    2414              CALL histwrite_phy(o_dtr_sat(iq-nqo),d_tr_sat(:,:,iq-nqo))
    2415              CALL histwrite_phy(o_dtr_uscav(iq-nqo),d_tr_uscav(:,:,iq-nqo))
    2416             !--2D fields
    2417              CALL histwrite_phy(o_dtr_dry(iq-nqo), flux_tr_dry(:,iq-nqo))
    2418              zx_tmp_fi2d=0.
    2419              IF (vars_defined) THEN
    2420                 DO k=1,klev
    2421                    zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,iq-nqo)
    2422                 ENDDO
    2423              ENDIF
    2424              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
    2425            ENDDO !--iq
    2426          ENDIF   !--type_trac
    2427 !
    2428          IF (type_trac == 'co2i') THEN
    2429            DO iq=nqo+1, nqtot
    2430              !--3D fields
    2431              CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
    2432              CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
    2433              CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
    2434              CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
     2500             CALL histwrite_phy(o_trac(itr), tr_seri(:,:,itr))
     2501             CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr))
     2502             CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr))
     2503             CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr))
    24352504             !--2D fields
    24362505             !--CO2 burden
     
    24382507             IF (vars_defined) THEN
    24392508                DO k=1,klev
    2440                    zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,iq-nqo)
     2509                   zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr)
    24412510                ENDDO
    24422511             ENDIF
    2443              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
     2512             CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d)
    24442513           ENDDO !--iq
    24452514           !--CO2 net fluxes
     
    24502519           CALL histwrite_phy(o_flx_co2_ff,    fco2_ff)
    24512520           CALL histwrite_phy(o_flx_co2_bb,    fco2_bb)
    2452          ENDIF !--type_trac co2i
    2453 
    2454          IF (type_trac == 'inco') THEN
    2455            nqup = nqo+1
    2456            DO iq=nqo+1, nqup
     2521
     2522         ELSE IF (ANY(types_trac == 'inco')) THEN
     2523           itr = 0
     2524           DO iq = 1, nqtot
     2525             IF(.NOT.tracers(iq)%isInPhysics) CYCLE
     2526             itr = itr+1
     2527             IF(tracers(iq)%component /= 'co2i') CYCLE
    24572528             !--3D fields
    2458              CALL histwrite_phy(o_trac(iq-nqo), tr_seri(:,:,iq-nqo))
    2459              CALL histwrite_phy(o_dtr_vdf(iq-nqo),d_tr_cl(:,:,iq-nqo))
    2460              CALL histwrite_phy(o_dtr_the(iq-nqo),d_tr_th(:,:,iq-nqo))
    2461              CALL histwrite_phy(o_dtr_con(iq-nqo),d_tr_cv(:,:,iq-nqo))
     2529             CALL histwrite_phy(o_trac   (itr),tr_seri(:,:,itr))
     2530             CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr))
     2531             CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr))
     2532             CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr))
    24622533             !--2D fields
    24632534             !--CO2 burden
     
    24652536             IF (vars_defined) THEN
    24662537                DO k=1,klev
    2467                    zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,iq-nqo)
     2538                   zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr)
    24682539                ENDDO
    24692540             ENDIF
    2470              CALL histwrite_phy(o_trac_cum(iq-nqo), zx_tmp_fi2d)
     2541             CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d)
    24712542           ENDDO !--iq
    24722543           !--CO2 net fluxes
     
    24772548           CALL histwrite_phy(o_flx_co2_ff,    fco2_ff)
    24782549           CALL histwrite_phy(o_flx_co2_bb,    fco2_bb)
    2479          ENDIF !--type_trac inco
    2480 
     2550
     2551         ELSE IF (ANY(type_trac==['lmdz|coag','lmdz     ','coag     '])) THEN
     2552           itr = 0
     2553           DO iq = 1, nqtot
     2554             IF(.NOT.tracers(iq)%isInPhysics) CYCLE
     2555             itr = itr + 1
     2556!            write(*,*) 'phys_output_write_mod 2337: itr=',itr
     2557             !--3D fields
     2558             CALL histwrite_phy(o_trac(itr), tr_seri(:,:,itr))
     2559             CALL histwrite_phy(o_dtr_vdf(itr),d_tr_cl(:,:,itr))
     2560             CALL histwrite_phy(o_dtr_the(itr),d_tr_th(:,:,itr))
     2561             CALL histwrite_phy(o_dtr_con(itr),d_tr_cv(:,:,itr))
     2562             CALL histwrite_phy(o_dtr_lessi_impa(itr),d_tr_lessi_impa(:,:,itr))
     2563             CALL histwrite_phy(o_dtr_lessi_nucl(itr),d_tr_lessi_nucl(:,:,itr))
     2564             CALL histwrite_phy(o_dtr_insc(itr),d_tr_insc(:,:,itr))
     2565             CALL histwrite_phy(o_dtr_bcscav(itr),d_tr_bcscav(:,:,itr))
     2566             CALL histwrite_phy(o_dtr_evapls(itr),d_tr_evapls(:,:,itr))
     2567             CALL histwrite_phy(o_dtr_ls(itr),d_tr_ls(:,:,itr))
     2568             CALL histwrite_phy(o_dtr_trsp(itr),d_tr_trsp(:,:,itr))
     2569             CALL histwrite_phy(o_dtr_sscav(itr),d_tr_sscav(:,:,itr))
     2570             CALL histwrite_phy(o_dtr_sat(itr),d_tr_sat(:,:,itr))
     2571             CALL histwrite_phy(o_dtr_uscav(itr),d_tr_uscav(:,:,itr))
     2572            !--2D fields
     2573             CALL histwrite_phy(o_dtr_dry(itr), flux_tr_dry(:,itr))
     2574             zx_tmp_fi2d=0.
     2575             IF (vars_defined) THEN
     2576                DO k=1,klev
     2577                   zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*tr_seri(:,k,itr)
     2578                ENDDO
     2579             ENDIF
     2580             CALL histwrite_phy(o_trac_cum(itr), zx_tmp_fi2d)
     2581           ENDDO !--iq
     2582         ENDIF   !--type_trac
    24812583       ENDIF   !(iflag_phytrac==1)
    24822584
     
    24942596       end if
    24952597
     2598#ifdef ISO
     2599    do ixt=1,ntiso
     2600!        write(*,*) 'ixt'
     2601        IF (vars_defined) zx_tmp_fi2d(:) = xtrain_fall(ixt,:) + xtsnow_fall(ixt,:)
     2602        CALL histwrite_phy(o_xtprecip(ixt), zx_tmp_fi2d)
     2603
     2604        IF (vars_defined) zx_tmp_fi2d(:) = xtrain_lsc(ixt,:) + xtsnow_lsc(ixt,:)
     2605        CALL histwrite_phy(o_xtplul(ixt), zx_tmp_fi2d)
     2606
     2607        IF (vars_defined) zx_tmp_fi2d(:) = xtrain_con(ixt,:) + xtsnow_con(ixt,:)
     2608        CALL histwrite_phy(o_xtpluc(ixt), zx_tmp_fi2d)
     2609        CALL histwrite_phy(o_xtevap(ixt),   xtevap(ixt,:))
     2610        CALL histwrite_phy(o_xtovap(ixt),  xt_seri(ixt,:,:))
     2611        CALL histwrite_phy(o_xtoliq(ixt), xtl_seri(ixt,:,:))
     2612
     2613        IF (vars_defined) zx_tmp_fi3d(:,:)=xtl_seri(ixt,:,:)+xts_seri(ixt,:,:)
     2614        CALL histwrite_phy(o_xtcond(ixt), zx_tmp_fi3d)
     2615        CALL histwrite_phy(o_dxtdyn(ixt),   d_xt_dyn(ixt,:,:))
     2616        CALL histwrite_phy(o_dxtldyn(ixt), d_xtl_dyn(ixt,:,:))
     2617
     2618        IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_con(ixt,:,:)/pdtphys
     2619        CALL histwrite_phy(o_dxtcon(ixt), zx_tmp_fi3d)
     2620
     2621        IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_lsc(ixt,:,:)/pdtphys
     2622        CALL histwrite_phy(o_dxtlsc(ixt), zx_tmp_fi3d)
     2623
     2624        IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_eva(ixt,:,:)/pdtphys
     2625        CALL histwrite_phy(o_dxteva(ixt), zx_tmp_fi3d)
     2626
     2627        IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_vdf(ixt,:,:)/pdtphys
     2628        CALL histwrite_phy(o_dxtvdf(ixt), zx_tmp_fi3d)
     2629
     2630        IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_ajsb(ixt,:,:)/pdtphys
     2631        CALL histwrite_phy(o_dxtajs(ixt), zx_tmp_fi3d)
     2632
     2633        IF (vars_defined) zx_tmp_fi3d(:,:)=(d_xt_ajs(ixt,:,:)-d_xt_ajsb(ixt,:,:))/pdtphys
     2634        CALL histwrite_phy(o_dxtthe(ixt), zx_tmp_fi3d)
     2635
     2636        IF (ok_qch4) THEN
     2637          IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_ch4(ixt,:,:)/pdtphys
     2638          CALL histwrite_phy(o_dxtch4(ixt), zx_tmp_fi3d)
     2639        END IF
     2640
     2641        IF (ixt == iso_HTO) THEN
     2642          IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_prod_nucl(ixt,:,:)/pdtphys
     2643          CALL histwrite_phy(o_dxtprod_nucl(ixt), zx_tmp_fi3d)
     2644
     2645          IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_cosmo(ixt,:,:)/pdtphys
     2646          CALL histwrite_phy(o_dxtcosmo(ixt), zx_tmp_fi3d)
     2647
     2648          IF (vars_defined) zx_tmp_fi3d(:,:)=d_xt_decroiss(ixt,:,:)/pdtphys
     2649          CALL histwrite_phy(o_dxtdecroiss(ixt), zx_tmp_fi3d)
     2650        END IF
     2651
     2652    !write(*,*) 'phys_output_write_mod 2531'
     2653    enddo
     2654#endif
     2655
    24962656       IF (.NOT.vars_defined) THEN
    24972657          !$OMP MASTER
Note: See TracChangeset for help on using the changeset viewer.