Ignore:
Timestamp:
Nov 19, 2021, 4:58:59 PM (3 years 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/physiq_mod.F90

    r3798 r4013  
    3939    USE ioipsl_getin_p_mod, ONLY : getin_p
    4040    USE indice_sol_mod
    41     USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac
     41    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, type_trac, nqCO2
    4242    USE iophy
    4343    USE limit_read_mod, ONLY : init_limit_read
     
    5959    USE phys_output_mod
    6060    USE phys_output_ctrlout_mod
    61     USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level
     61    USE print_control_mod, ONLY: mydebug=>debug , lunout, prt_level, &
     62         alert_first_call, call_alert, prt_alerte
    6263    USE readaerosol_mod, ONLY : init_aero_fromfile
    6364    USE readaerosolstrato_m, ONLY : init_readaerosolstrato
     
    7374    USE VERTICAL_LAYERS_MOD, ONLY: aps,bps, ap, bp
    7475    USE write_field_phy
     76    USE lscp_mod, ONLY : lscp
    7577
    7678    !USE cmp_seri_mod
     
    197199       cdragm, cdragh,                   &
    198200       zustar, zu10m, zv10m, rh2m, qsat2m, &
    199        zq2m, zt2m, weak_inversion, &
    200        zq2m_cor,zt2m_cor,zu10m_cor,zv10m_cor, & ! pour corriger d'un bug
    201        zrh2m_cor,zqsat2m_cor, &
     201       zq2m, zt2m, zn2mout, weak_inversion, &
    202202       zt2m_min_mon, zt2m_max_mon,   &         ! pour calcul_divers.h
    203203       t2m_min_mon, t2m_max_mon,  &            ! pour calcul_divers.h
     
    212212       zxrunofflic,                            &
    213213       zxtsol, snow_lsc, zxfqfonte, zxqsurf,   &
     214       delta_qsurf,                            &
    214215       rain_lsc, rain_num,                     &
    215216       !
     
    219220       d_t_vdf_x, d_t_vdf_w, &
    220221       d_q_vdf_x, d_q_vdf_w, &
    221        pbl_tke_input, &
     222       pbl_tke_input, tke_dissip, l_mix, wprime,&
    222223       t_therm, q_therm, u_therm, v_therm, &
    223224       cdragh_x, cdragh_w, &
     
    246247       alp_bl_stat, n2, s2,  &
    247248       proba_notrig, random_notrig,  &
    248        cv_gen,  &
     249!!       cv_gen,  &  !moved to phys_state_var_mod
    249250       !
    250251       dnwd0,  &
     
    355356    LOGICAL, SAVE :: ok_volcan ! pour activer les diagnostics volcaniques
    356357    !$OMP THREADPRIVATE(ok_volcan)
     358    INTEGER, SAVE :: flag_volc_surfstrat ! pour imposer le cool/heat rate à la surf ou dans la strato
     359    !$OMP THREADPRIVATE(flag_volc_surfstrat)
    357360    LOGICAL ok_cvl  ! pour activer le nouveau driver pour convection KE
    358361    PARAMETER (ok_cvl=.TRUE.)
     
    617620    !$OMP THREADPRIVATE(iflag_alp_wk_cond)
    618621
    619     INTEGER,  SAVE               :: iflag_bug_t2m_ipslcm61=1 !
    620     !$OMP THREADPRIVATE(iflag_bug_t2m_ipslcm61)
    621     INTEGER,  SAVE               :: iflag_bug_t2m_stab_ipslcm61=-1 !
    622     !$OMP THREADPRIVATE(iflag_bug_t2m_stab_ipslcm61)
    623 
    624622    REAL t_w(klon,klev),q_w(klon,klev) ! temperature and moisture profiles in the wake region
    625623    REAL t_x(klon,klev),q_x(klon,klev) ! temperature and moisture profiles in the off-wake region
     
    963961    !IM cf. AM 081204 BEG
    964962    LOGICAL ptconvth(klon,klev)
     963
     964    REAL picefra(klon,klev)
    965965    !IM cf. AM 081204 END
    966966    !
     
    10341034!JLD    REAL zstophy, zout
    10351035
    1036     CHARACTER*20 modname
    1037     CHARACTER*80 abort_message
     1036    CHARACTER (LEN=20) :: modname='physiq_mod'
     1037    CHARACTER*80 message, abort_message
    10381038    LOGICAL, SAVE ::  ok_sync, ok_sync_omp
    10391039    !$OMP THREADPRIVATE(ok_sync)
     
    11861186    integer iostat
    11871187
     1188    REAL, dimension(klon,klev+1) :: tke_dissip_ave, l_mix_ave, wprime_ave
    11881189    REAL zzz
    11891190    !albedo SB >>>
     
    12001201    pi = 4. * ATAN(1.)
    12011202
     1203    ! set-up call to alerte function
     1204    call_alert = (alert_first_call .AND. is_master)
     1205   
    12021206    ! Ehouarn: set value of jjmp1 since it is no longer a "fixed parameter"
    12031207    jjmp1=nbp_lat
     
    12611265            fact_cldcon, facttemps,ok_newmicro,iflag_radia, &
    12621266            iflag_cld_th,iflag_ratqs,ratqsbas,ratqshaut,tau_ratqs, &
    1263             ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, aerosol_couple, &
    1264             chemistry_couple, &
    1265             flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
     1267            ok_ade, ok_aie, ok_alw, ok_cdnc, ok_volcan, flag_volc_surfstrat, aerosol_couple, &
     1268            chemistry_couple, flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
    12661269            flag_bc_internal_mixture, bl95_b0, bl95_b1, &
    12671270                                ! nv flags pour la convection et les
     
    13171320    forall (k=1: nbp_lev) zmasse(:, k) = (paprs(:, k)-paprs(:, k+1)) / rg
    13181321
    1319     modname = 'physiq'
    13201322
    13211323    IF (debut) THEN
     
    13281330       tau_gl=86400.*tau_gl
    13291331       WRITE(lunout,*) 'debut physiq_mod tau_gl=',tau_gl
    1330 
    1331        iflag_bug_t2m_ipslcm61 = 1
    1332        CALL getin_p('iflag_bug_t2m_ipslcm61', iflag_bug_t2m_ipslcm61)
    1333        iflag_bug_t2m_stab_ipslcm61 = -1
    1334        CALL getin_p('iflag_bug_t2m_stab_ipslcm61', iflag_bug_t2m_stab_ipslcm61)
    13351332
    13361333       CALL getin_p('iflag_alp_wk_cond', iflag_alp_wk_cond)
     
    14241421       tau_overturning_th(:)=0.
    14251422
    1426        IF (type_trac == 'inca') THEN
     1423       IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
    14271424          ! jg : initialisation jusqu'au ces variables sont dans restart
    14281425          ccm(:,:,:) = 0.
     
    15351532       ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    15361533       CALL init_iophy_new(latitude_deg,longitude_deg)
    1537        CALL create_etat0_limit_unstruct
    1538        CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)
    15391534
    15401535          !===================================================================
     
    17031698
    17041699       CALL iniradia(klon,klev,paprs(1,1:klev+1))
    1705 
    1706        ! Initialisation des champs dans phytrac* qui sont utilisés par phys_output_write*
     1700       !
     1701!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1702       ! Initialisation des champs dans phytrac* qui sont utilises par phys_output_write*
     1703       !
     1704!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1705
    17071706#ifdef CPP_Dust
    17081707       ! Quand on utilise SPLA, on force iflag_phytrac=1
     
    17331732#endif
    17341733       IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)
     1734       CALL create_etat0_limit_unstruct
     1735       CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)
    17351736
    17361737!jyg<
     
    17471748            ENDDO
    17481749          ENDDO
    1749         ELSE
     1750       ELSE
    17501751          pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??
    17511752!>jyg
     
    17911792          CALL abort_physic(modname,abort_message,1)
    17921793       ENDIF
     1794
     1795!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1796       ! Initialisation pour la convection de K.E. et pour les poches froides
     1797       !
     1798!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1799
    17931800       WRITE(lunout,*)"Clef pour la convection, iflag_con=", iflag_con
    1794        WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", &
    1795             ok_cvl
     1801       WRITE(lunout,*)"Clef pour le driver de la convection, ok_cvl=", ok_cvl
    17961802       !
    17971803       !KE43
     
    18401846             d_s_wk(:) = 0.
    18411847             d_dens_wk(:) = 0.
    1842           ENDIF
     1848          ENDIF  !  (iflag_wake>=1)
    18431849
    18441850          !        do i = 1,klon
     
    18511857       !   ALLOCATE(lonGCM(0), latGCM(0))
    18521858       !   ALLOCATE(iGCM(0), jGCM(0))
    1853        ENDIF
    1854 
     1859       ENDIF  !  (iflag_con.GE.3)
     1860       !
    18551861       DO i=1,klon
    18561862          rugoro(i) = f_rugoro * MAX(1.0e-05, zstd(i)*zsig(i)/2.0)
     
    19211927       !$OMP BARRIER
    19221928       missing_val=missing_val_omp
     1929       !
     1930       ! Now we activate some double radiation call flags only if some
     1931       ! diagnostics are requested, otherwise there is no point in doing this
     1932       IF (is_master) THEN
     1933         !--setting up swaero_diag to TRUE in XIOS case
     1934         IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &
     1935            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &
     1936            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &
     1937              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &
     1938                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &
     1939            !!!--for now these fields are not in the XML files so they are omitted
     1940            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &
     1941            swaero_diag=.TRUE.
     1942 
     1943         !--setting up swaerofree_diag to TRUE in XIOS case
     1944         IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
     1945            xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
     1946            xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
     1947            xios_field_is_active("LWupTOAcleanclr")) &
     1948            swaerofree_diag=.TRUE.
     1949 
     1950         !--setting up dryaod_diag to TRUE in XIOS case
     1951         DO naero = 1, naero_tot-1
     1952          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.
     1953         ENDDO
     1954         !
     1955         !--setting up ok_4xCO2atm to TRUE in XIOS case
     1956         IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &
     1957            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
     1958            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
     1959            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
     1960            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
     1961            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
     1962            ok_4xCO2atm=.TRUE.
     1963       ENDIF
     1964       !$OMP BARRIER
     1965       CALL bcast(swaero_diag)
     1966       CALL bcast(swaerofree_diag)
     1967       CALL bcast(dryaod_diag)
     1968       CALL bcast(ok_4xCO2atm)
    19231969#endif
    1924 
    1925 
     1970       !
    19261971       CALL printflag( tabcntr0,radpas,ok_journe, &
    19271972            ok_instan, ok_region )
    19281973       !
    19291974       !
    1930        !
    19311975       ! Prescrire l'ozone dans l'atmosphere
    1932        !
    19331976       !
    19341977       !c         DO i = 1, klon
     
    19381981       !c         ENDDO
    19391982       !
    1940        IF (type_trac == 'inca') THEN
     1983       IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN                   ! ModThL
    19411984#ifdef INCA
    19421985          CALL VTe(VTphysiq)
     
    19551998               klon, &
    19561999               nqtot, &
    1957                nqo, &
     2000               nqo+nqCO2, &
    19582001               pdtphys, &
    19592002               annee_ref, &
     
    19862029#endif
    19872030       ENDIF
     2031       !
    19882032       IF (type_trac == 'repr') THEN
    19892033#ifdef REPROBUS
     
    20342078          SFRWL(6)=3.02191470E-02
    20352079       END SELECT
    2036 
    2037 
    20382080       !albedo SB <<<
    20392081
     
    21582200      ! RomP <<<
    21592201    ENDIF
    2160 
    21612202    !
    21622203    ! Ne pas affecter les valeurs entrees de u, v, h, et q
     
    24972538    !   s_therm,   s_trmb1,   s_trmb2, s_trmb3,
    24982539    !   zu10m,     zv10m,   fder,
    2499     !   zxqsurf,   rh2m,      zxfluxu, zxfluxv,
     2540    !   zxqsurf,   delta_qsurf,
     2541    !   rh2m,      zxfluxu, zxfluxv,
    25002542    !   frugs,     agesno,    fsollw,  fsolsw,
    25012543    !   d_ts,      fevap,     fluxlat, t2m,
     
    25472589            debut,     lafin, &
    25482590            longitude_deg, latitude_deg, rugoro,  zrmu0,      &
    2549             zsig,      sollwdown, pphi,    cldt,      &
     2591             sollwdown,    cldt,      &
    25502592            rain_fall, snow_fall, solsw,   solswfdiff, sollw,     &
    25512593            gustiness,                                &
     
    25582600                                !albedo SB <<<
    25592601            cdragh,    cdragm,  u1,    v1,            &
     2602            beta_aridity, &
    25602603                                !albedo SB >>>
    25612604                                ! albsol1,   albsol2,   sens,    evap,      &
     
    25632606                                !albedo SB <<<
    25642607            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, &
    2565             zxtsol,    zxfluxlat, zt2m,    qsat2m,  &
     2608            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, &
    25662609            d_t_vdf,   d_q_vdf,   d_u_vdf, d_v_vdf, d_t_diss, &
    25672610                                !nrlmd<
     
    25842627            s_therm,   s_trmb1,   s_trmb2, s_trmb3, &
    25852628            zustar, zu10m,     zv10m,   fder, &
    2586             zxqsurf,   rh2m,      zxfluxu, zxfluxv, &
     2629            zxqsurf, delta_qsurf,   rh2m,      zxfluxu, zxfluxv, &
    25872630            z0m, z0h,     agesno,    fsollw,  fsolsw, &
    25882631            d_ts,      fevap,     fluxlat, t2m, &
     
    26102653!>jyg
    26112654       ENDIF
    2612 
    2613 !add limitation for t,q at and wind at 10m
    2614         if ( iflag_bug_t2m_ipslcm61 == 0 ) THEN
    2615           CALL borne_var_surf( klon,klev,nbsrf,                 &
    2616             iflag_bug_t2m_stab_ipslcm61,                        &
    2617             t_seri(:,1),q_seri(:,1),u_seri(:,1),v_seri(:,1),    &
    2618             ftsol,zxqsurf,pctsrf,paprs,                         &
    2619             t2m, q2m, u10m, v10m,                               &
    2620             zt2m_cor, zq2m_cor, zu10m_cor, zv10m_cor,           &
    2621             zrh2m_cor, zqsat2m_cor)
    2622         ELSE
    2623           zt2m_cor(:)=zt2m(:)
    2624           zq2m_cor(:)=zq2m(:)
    2625           zu10m_cor(:)=zu10m(:)
    2626           zv10m_cor(:)=zv10m(:)
    2627           zqsat2m_cor=999.999
    2628         ENDIF
    26292655
    26302656       !---------------------------------------------------------------------
     
    34733499    ! Computation of ratqs, the width (normalized) of the subrid scale
    34743500    ! water distribution
     3501
     3502    tke_dissip_ave(:,:)=0.
     3503    l_mix_ave(:,:)=0.
     3504    wprime_ave(:,:)=0.
     3505
     3506
     3507    DO nsrf = 1, nbsrf
     3508       DO i = 1, klon
     3509          tke_dissip_ave(i,:) = tke_dissip_ave(i,:) + tke_dissip(i,:,nsrf)*pctsrf(i,nsrf)
     3510          l_mix_ave(i,:) = l_mix_ave(i,:) + l_mix(i,:,nsrf)*pctsrf(i,nsrf)
     3511          wprime_ave(i,:) = wprime_ave(i,:) + wprime(i,:,nsrf)*pctsrf(i,nsrf)
     3512       ENDDO
     3513    ENDDO
     3514
     3515
    34753516    CALL  calcratqs(klon,klev,prt_level,lunout,        &
    34763517         iflag_ratqs,iflag_con,iflag_cld_th,pdtphys,  &
    34773518         ratqsbas,ratqshaut,ratqsp0, ratqsdp, &
    3478          tau_ratqs,fact_cldcon,   &
     3519         tau_ratqs,fact_cldcon,wake_s, wake_deltaq,   &
    34793520         ptconv,ptconvth,clwcon0th, rnebcon0th,     &
    3480          paprs,pplay,q_seri,zqsat,fm_therm, &
    3481          ratqs,ratqsc)
    3482 
     3521         paprs,pplay,t_seri,q_seri, qtc_cv, sigt_cv, zqsat, &
     3522         pbl_tke(:,:,is_ave),tke_dissip_ave,l_mix_ave,wprime_ave,t2m,q2m,fm_therm, &
     3523         ratqs,ratqsc,ratqs_inter)
    34833524
    34843525    !
     
    34893530       print *,'itap, ->fisrtilp ',itap
    34903531    ENDIF
    3491     !
     3532
     3533    picefra(:,:)=0.
     3534
     3535    IF (ok_new_lscp) THEN
     3536
     3537    CALL lscp(phys_tstep,paprs,pplay, &
     3538         t_seri, q_seri,ptconv,ratqs, &
     3539         d_t_lsc, d_q_lsc, d_ql_lsc, d_qi_lsc, rneb, cldliq, picefra, &
     3540         rain_lsc, snow_lsc, &
     3541         pfrac_impa, pfrac_nucl, pfrac_1nucl, &
     3542         frac_impa, frac_nucl, beta_prec_fisrt, &
     3543         prfl, psfl, rhcl,  &
     3544         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
     3545         iflag_ice_thermo)
     3546
     3547    ELSE
    34923548    CALL fisrtilp(phys_tstep,paprs,pplay, &
    34933549         t_seri, q_seri,ptconv,ratqs, &
     
    34993555         zqasc, fraca,ztv,zpspsk,ztla,zthl,iflag_cld_th, &
    35003556         iflag_ice_thermo)
    3501     !
     3557    ENDIF
    35023558    WHERE (rain_lsc < 0) rain_lsc = 0.
    35033559    WHERE (snow_lsc < 0) snow_lsc = 0.
     
    37683824    ENDDO
    37693825
    3770     IF (type_trac == 'inca') THEN
     3826    IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN      ! ModThL
    37713827#ifdef INCA
    37723828       CALL VTe(VTphysiq)
     
    38113867            nbp_lon, &
    38123868            nbp_lat-1, &
    3813             tr_seri, &
     3869            tr_seri(:,:,1+nqCO2:nbtr), &
    38143870            ftsol, &
    38153871            paprs, &
     
    38223878       CALL VTe(VTinca)
    38233879       CALL VTb(VTphysiq)
    3824 #endif 
    3825     ENDIF !type_trac = inca
     3880#endif
     3881    ENDIF !type_trac = inca or inco
    38263882    IF (type_trac == 'repr') THEN
    38273883#ifdef REPROBUS
     
    39944050
    39954051       IF (ok_newmicro) then
    3996           IF (iflag_rrtm.NE.0) THEN
     4052! AI          IF (iflag_rrtm.NE.0) THEN
     4053          IF (iflag_rrtm.EQ.1) THEN
    39974054#ifdef CPP_RRTM
    39984055             IF (ok_cdnc.AND.NRADLP.NE.3) THEN
     
    40084065          ENDIF
    40094066          CALL newmicro (flag_aerosol, ok_cdnc, bl95_b0, bl95_b1, &
    4010                paprs, pplay, t_seri, cldliq, cldfra, &
     4067               paprs, pplay, t_seri, cldliq, picefra, cldfra, &
    40114068               cldtau, cldemi, cldh, cldl, cldm, cldt, cldq, &
    40124069               flwp, fiwp, flwc, fiwc, &
     
    40164073       ELSE
    40174074          CALL nuage (paprs, pplay, &
    4018                t_seri, cldliq, cldfra, cldtau, cldemi, &
     4075               t_seri, cldliq, picefra, cldfra, cldtau, cldemi, &
    40194076               cldh, cldl, cldm, cldt, cldq, &
    40204077               ok_aie, &
     
    41684225               t_seri,q_seri,wo, &
    41694226               cldfrarad, cldemirad, cldtaurad, &
    4170                ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, &
    4171                flag_aerosol, &
    4172                flag_aerosol_strat, flag_aer_feedback, &
     4227               ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
     4228               flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
    41734229               tau_aero, piz_aero, cg_aero, &
    41744230               tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
     
    42114267 
    42124268#ifndef CPP_XIOS
    4213           !--OB 30/05/2016 modified 21/10/2016
    4214           !--here we return swaero_diag and dryaod_diag to FALSE
    4215           !--and histdef will switch it back to TRUE if necessary
    4216           !--this is necessary to get the right swaero at first step
    4217           !--but only in the case of no XIOS as XIOS is covered elsewhere
    4218           IF (debut) swaerofree_diag = .FALSE.
    4219           IF (debut) swaero_diag = .FALSE.
    4220           IF (debut) dryaod_diag = .FALSE.
    4221           !--IM 15/09/2017 here we return ok_4xCO2atm to FALSE
    4222           !--as for swaero_diag, see above
    4223           IF (debut) ok_4xCO2atm = .FALSE.
    4224 
    4225           !
     4269
    42264270          !IM 2eme calcul radiatif pour le cas perturbe ou au moins un
    42274271          !IM des taux doit etre different du taux actuel
     
    42554299                     t_seri,q_seri,wo, &
    42564300                     cldfrarad, cldemirad, cldtaurad, &
    4257                      ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, &
    4258                      flag_aerosol, &
    4259                      flag_aerosol_strat, flag_aer_feedback, &
     4301                     ok_ade.OR.flag_aerosol_strat.GT.0, ok_aie,  ok_volcan, flag_volc_surfstrat, &
     4302                     flag_aerosol, flag_aerosol_strat, flag_aer_feedback, &
    42604303                     tau_aero, piz_aero, cg_aero, &
    42614304                     tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm, &
     
    42864329                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
    42874330                     ZSWFT0_i, ZFSDN0, ZFSUP0)
    4288           endif !ok_4xCO2atm
     4331          ENDIF !ok_4xCO2atm
    42894332       ENDIF ! aerosol_couple
    42904333       itaprad = 0
     
    46674710
    46684711    CALL tend_to_tke(pdtphys,paprs,exner,t_seri,u_seri,v_seri,dtadd,duadd,dvadd,pctsrf,pbl_tke)
    4669 
     4712   !
     4713   ! Prevent pbl_tke_w from becoming negative
     4714    wake_delta_pbl_tke(:,:,:) = max(wake_delta_pbl_tke(:,:,:), -pbl_tke(:,:,:))
     4715   !
    46704716
    46714717       ENDIF
     
    48104856    ELSE
    48114857       sh_in(:,:) = qx(:,:,ivap)
    4812        ch_in(:,:) = qx(:,:,iliq)
     4858       IF (nqo .EQ. 3) THEN
     4859          ch_in(:,:) = qx(:,:,iliq) + qx(:,:,isol)
     4860       ELSE
     4861          ch_in(:,:) = qx(:,:,iliq)
     4862       ENDIF
    48134863    ENDIF
    48144864
     
    49494999    ENDDO
    49505000    !
    4951     IF (type_trac == 'inca') THEN
     5001    IF (type_trac == 'inca' .OR. type_trac == 'inco') THEN
    49525002#ifdef INCA
    49535003       CALL VTe(VTphysiq)
     
    49585008            pplay, &
    49595009            t_seri, &
    4960             tr_seri, &
     5010            tr_seri(:,:,1+nqCO2:nbtr), &
    49615011            nbtr, &
    49625012            paprs, &
     
    51915241#endif
    51925242
    5193 ! Pour XIOS : On remet des variables a .false. apres un premier appel
    5194     IF (debut) THEN
    5195 #ifdef CPP_XIOS
    5196       swaero_diag=.FALSE.
    5197       swaerofree_diag=.FALSE.
    5198       dryaod_diag=.FALSE.
    5199       ok_4xCO2atm= .FALSE.
    5200 !      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
    5201 
    5202       IF (is_master) THEN
    5203         !--setting up swaero_diag to TRUE in XIOS case
    5204         IF (xios_field_is_active("topswad").OR.xios_field_is_active("topswad0").OR. &
    5205            xios_field_is_active("solswad").OR.xios_field_is_active("solswad0").OR. &
    5206            xios_field_is_active("topswai").OR.xios_field_is_active("solswai").OR.  &
    5207              (iflag_rrtm==1.AND.(xios_field_is_active("toplwad").OR.xios_field_is_active("toplwad0").OR. &
    5208                                  xios_field_is_active("sollwad").OR.xios_field_is_active("sollwad0"))))  &
    5209            !!!--for now these fields are not in the XML files so they are omitted
    5210            !!!  xios_field_is_active("toplwai").OR.xios_field_is_active("sollwai") !))) &
    5211            swaero_diag=.TRUE.
    5212 
    5213         !--setting up swaerofree_diag to TRUE in XIOS case
    5214         IF (xios_field_is_active("SWdnSFCcleanclr").OR.xios_field_is_active("SWupSFCcleanclr").OR. &
    5215            xios_field_is_active("SWupTOAcleanclr").OR.xios_field_is_active("rsucsaf").OR.   &
    5216            xios_field_is_active("rsdcsaf") .OR. xios_field_is_active("LWdnSFCcleanclr").OR. &
    5217            xios_field_is_active("LWupTOAcleanclr")) &
    5218            swaerofree_diag=.TRUE.
    5219 
    5220         !--setting up dryaod_diag to TRUE in XIOS case
    5221         DO naero = 1, naero_tot-1
    5222          IF (xios_field_is_active("dryod550_"//name_aero_tau(naero))) dryaod_diag=.TRUE.
    5223         ENDDO
    5224         !
    5225         !--setting up ok_4xCO2atm to TRUE in XIOS case
    5226         IF (xios_field_is_active("rsut4co2").OR.xios_field_is_active("rlut4co2").OR. &
    5227            xios_field_is_active("rsutcs4co2").OR.xios_field_is_active("rlutcs4co2").OR. &
    5228            xios_field_is_active("rsu4co2").OR.xios_field_is_active("rsucs4co2").OR. &
    5229            xios_field_is_active("rsd4co2").OR.xios_field_is_active("rsdcs4co2").OR. &
    5230            xios_field_is_active("rlu4co2").OR.xios_field_is_active("rlucs4co2").OR. &
    5231            xios_field_is_active("rld4co2").OR.xios_field_is_active("rldcs4co2")) &
    5232            ok_4xCO2atm=.TRUE.
    5233       ENDIF
    5234       !$OMP BARRIER
    5235       CALL bcast(swaero_diag)
    5236       CALL bcast(swaerofree_diag)
    5237       CALL bcast(dryaod_diag)
    5238       CALL bcast(ok_4xCO2atm)
    5239 !      write (lunout,*)'ok_4xCO2atm= ',swaero_diag, swaerofree_diag, dryaod_diag, ok_4xCO2atm
    5240 #endif
    5241     ENDIF
    5242 
    52435243    !====================================================================
    52445244    ! Arret du modele apres hgardfou en cas de detection d'un
     
    52585258    !
    52595259
     5260    ! Disabling calls to the prt_alerte function
     5261    alert_first_call = .FALSE.
     5262   
    52605263    IF (lafin) THEN
    52615264       itau_phy = itau_phy + itap
Note: See TracChangeset for help on using the changeset viewer.