Ignore:
Timestamp:
Jul 28, 2025, 7:23:15 PM (6 days ago)
Author:
aborella
Message:

Merge with trunk r5789

Location:
LMDZ6/branches/contrails
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/contrails

  • LMDZ6/branches/contrails/libf/phylmd/physiq_mod.F90

    r5790 r5791  
    2020! PLEASE try to follow this rule
    2121
    22     USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando
     22    USE ACAMA_GWD_rando_m, only: ACAMA_GWD_rando, ACAMA_GWD_rando_first
    2323    USE aero_mod
    2424    USE add_phys_tend_mod, only : add_pbl_tend, add_phys_tend, diag_phys_tend, prt_enerbil, &
     
    3232    USE dimphy
    3333    USE etat0_limit_unstruct_mod
    34     USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando
     34    USE FLOTT_GWD_rando_m, only: FLOTT_GWD_rando, FLOTT_GWD_rando_first
    3535    USE fonte_neige_mod, ONLY  : fonte_neige_get_vars
    3636    USE geometry_mod, ONLY: cell_area, latitude_deg, longitude_deg
     
    3939    USE ioipsl_getin_p_mod, ONLY : getin_p
    4040    USE indice_sol_mod
    41     USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, addPhase, ivap, iliq, isol, ibs, icf, iqvc, icfc, iqtc, inic
     41    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, nqtke, tracers, type_trac, addPhase, ivap, iliq, isol, ibs, icf, iqvc, itke, icfc, iqtc, inic
    4242    USE strings_mod,  ONLY: strIdx
    4343    USE iophy
     
    4949    USE netcdf, only: nf90_fill_real     ! IM for NMC files
    5050    USE open_climoz_m, only: open_climoz ! ozone climatology from a file
     51    USE orografi_mod, ONLY: drag_noro, lift_noro, sugwd
     52    USE orografi_strato_mod, ONLY: drag_noro_strato, lift_noro_strato, sugwd_strato
    5153    USE ozonecm_m, only: ozonecm ! ozone of J.-F. Royer
    5254    USE pbl_surface_mod, ONLY : pbl_surface
     
    9698    USE lmdz_cloud_optics_prop_ini, ONLY : cloud_optics_prop_ini
    9799    USE phys_output_var_mod, ONLY :      cloudth_sth,cloudth_senv,cloudth_sigmath,cloudth_sigmaenv
    98     USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2
     100    USE phys_output_var_mod, ONLY : cloud_cover_sw, cloud_cover_sw_s2, ZFLUX_DIR, ZFLUX_DIR_CLEAR, &
     101  &      ZFLUX_DIR_s2, ZFLUX_DIR_CLEAR_s2, ZFLUX_DIR_SUN, ZFLUX_DIR_SUN_s2
     102    USE phys_output_var_mod, ONLY : type_ecri
    99103
    100104
     
    114118    USE infotrac_phy,      ONLY: nqCO2
    115119    USE lmdz_reprobus_wrappers, ONLY: init_chem_rep_xjour, d_q_rep, d_ql_rep, d_qi_rep, &
    116                         ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B, chemini_rep, chemtime_rep, coord_hyb_rep, &
    117             rtime
     120         ptrop, ttrop, ztrop, gravit, itroprep, Z1, Z2, fac, B, &
     121         chemini_rep, rtime, chemtime_rep, coord_hyb_rep
    118122    USE time_phylmdz_mod,    ONLY: annee_ref, day_ini, day_ref, start_time
    119123    USE vertical_layers_mod, ONLY: aps, bps, ap, bp
     
    154158       ! Dynamic tendencies (diagnostics)
    155159       d_t_dyn,d_q_dyn,d_ql_dyn,d_qs_dyn,d_qbs_dyn, &
    156        d_u_dyn,d_v_dyn,d_cf_dyn,d_qvc_dyn,d_tr_dyn, &
     160       d_u_dyn,d_v_dyn,d_cf_dyn,d_qvc_dyn,d_tke_dyn,d_tr_dyn, &
    157161       d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d,d_qbs_dyn2d, &
    158162       ! Physic tendencies
     
    372376       rneb,  &
    373377       zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic, &
    374        zxfluxt,zxfluxq
     378!GG       zxfluxt,zxfluxq
     379       zxfluxt,zxfluxq, &
     380       fcds, fcdi, dh_basal_growth, dh_basal_melt, &
     381       dh_top_melt, dh_snow2sic, &
     382       dtice_melt, dtice_snow2sic
     383!GG
    375384       !
    376385       USE phys_local_var_mod, ONLY: zfice, dNovrN, ptconv
     
    392401       USE phys_output_write_spl_mod, ONLY: phys_output_write_spl
    393402       USE phytracr_spl_mod, ONLY: phytracr_spl_out_init, phytracr_spl
    394        USE s2s, ONLY : s2s_initialize
     403       USE s2s, ONLY : s2s_initialize, s2s_finalize
    395404    IMPLICIT NONE
    396405    !>======================================================================
     
    14491458       ENDIF
    14501459
     1460       IF (ok_advtke) THEN
     1461        IF (nqtke .LT. 1) THEN
     1462            WRITE (lunout, *) 'activation of TKE advection need a specific TKE tracer', &
     1463                              'but nqtke=', nqtke
     1464            abort_message='see above'
     1465            CALL abort_physic(modname,abort_message, 1)
     1466        ENDIF
     1467       ENDIF
     1468
     1469
    14511470       Ncvpaseq1 = 0
    14521471       dnwd0=0.0
     
    17751794       ok_sync=ok_sync_omp
    17761795
    1777        freq_outNMC(1) = ecrit_files(7)
    1778        freq_outNMC(2) = ecrit_files(8)
    1779        freq_outNMC(3) = ecrit_files(9)
    1780        WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1)
    1781        WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2)
    1782        WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
     1796!       freq_outNMC(1) = ecrit_files(7)
     1797!       freq_outNMC(2) = ecrit_files(8)
     1798!       freq_outNMC(3) = ecrit_files(9)
     1799!       WRITE(lunout,*)'OK freq_outNMC(1)=',freq_outNMC(1)
     1800!       WRITE(lunout,*)'OK freq_outNMC(2)=',freq_outNMC(2)
     1801!       WRITE(lunout,*)'OK freq_outNMC(3)=',freq_outNMC(3)
    17831802
    17841803#ifndef CPP_XIOS
     
    18501869       CALL iniradia(klon,klev,paprs(1,1:klev+1))
    18511870
     1871       
    18521872!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    18531873       CALL surf_wind_ini(klon,lunout)
    18541874       CALL getin_p('nsurfwind',nsurfwind)
    18551875       allocate(surf_wind_value(klon,nsurfwind),surf_wind_proba(klon,nsurfwind))
    1856    
     1876!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1877       ! initialisation des variables tkeoro
     1878       addtkeoro=0
     1879       CALL getin_p('addtkeoro',addtkeoro)
     1880
     1881       alphatkeoro=1.
     1882       CALL getin_p('alphatkeoro',alphatkeoro)
     1883       alphatkeoro=min(max(0.,alphatkeoro),1.)
     1884
     1885       smallscales_tkeoro=.FALSE.
     1886       CALL getin_p('smallscales_tkeoro',smallscales_tkeoro)
     1887       
    18571888!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    18581889       CALL wake_ini(rg,rd,rv,prt_level)
     
    24842515       ENDDO
    24852516    ENDDO
    2486     !
     2517
     2518    ! in case of TKE advection, we interpolate vertically
     2519    ! since TKE is defined at the bottom interface of layers but
     2520    ! it is interpolated onto middle layers for advection
     2521
     2522    IF (ok_advtke) THEN
     2523      DO k=2,klev
     2524        DO i=1,klon
     2525           pbl_tke(i,k,:)=(qx(i,k-1,itke)*zmasse(i,k-1)+qx(i,k,itke)*zmasse(i,k))/(zmasse(i,k-1)+zmasse(i,k))
     2526        ENDDO
     2527      ENDDO
     2528    ENDIF
     2529
     2530    tke0(:,:)=pbl_tke(:,:,is_ave)
     2531
     2532
    24872533    !--OB water mass fixer
    24882534    IF (ok_water_mass_fixer) THEN
     
    25012547    !--fin mass fixer
    25022548
    2503     tke0(:,:)=pbl_tke(:,:,is_ave)
    2504     IF (nqtot > nqo) THEN
     2549    IF (nqtot > (nqo+nqtke)) THEN
    25052550       ! water isotopes are not included in tr_seri
    25062551       itr = 0
     
    25582603       d_qtc_dyn(:,:)= (qtc_seri(:,:)-qtc_ancien(:,:))/phys_tstep
    25592604       d_nic_dyn(:,:)= (nic_seri(:,:)-nic_ancien(:,:))/phys_tstep
     2605       d_tke_dyn(:,:)= (pbl_tke(:,:,is_ave)-tke_ancien(:,:))/phys_tstep
    25602606       CALL water_int(klon,klev,q_seri,zmasse,zx_tmp_fi2d)
    25612607       d_q_dyn2d(:)=(zx_tmp_fi2d(:)-prw_ancien(:))/phys_tstep
     
    25672613       d_qbs_dyn2d(:)=(zx_tmp_fi2d(:)-prbsw_ancien(:))/phys_tstep
    25682614       ! !! RomP >>>   td dyn traceur
    2569        IF (nqtot > nqo) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep
     2615       IF (nqtot > (nqo+nqtke)) d_tr_dyn(:,:,:)=(tr_seri(:,:,:)-tr_ancien(:,:,:))/phys_tstep
    25702616       ! !! RomP <<<
    25712617    ELSE
     
    25822628       d_qtc_dyn(:,:)= 0.0
    25832629       d_nic_dyn(:,:)= 0.0
     2630       d_tke_dyn(:,:)= 0.0
    25842631       d_q_dyn2d(:)  = 0.0
    25852632       d_ql_dyn2d(:) = 0.0
     
    25872634       d_qbs_dyn2d(:)= 0.0
    25882635       ! !! RomP >>>   td dyn traceur
    2589        IF (nqtot > nqo) d_tr_dyn(:,:,:)= 0.0
     2636       IF (nqtot > (nqo+nqtke)) d_tr_dyn(:,:,:)= 0.0
    25902637       ! !! RomP <<<
    25912638       ancien_ok = .TRUE.
     
    29432990            debut,     lafin, &
    29442991            longitude_deg, latitude_deg, rugoro,  zrmu0,      &
    2945             sollwdown,    cldt,      &
     2992        !GG    sollwdown,    cldt,      &
     2993            sollwdown, pphi,   cldt,      &
     2994        !GG
    29462995            rain_fall, snow_fall, bs_fall, solsw,   solswfdiff, sollw,     &
    29472996            gustiness,                                &
     
    29883037            wake_delta_pbl_TKE, &
    29893038                                !>nrlmd+jyg
    2990              treedrg, &
     3039!GG             treedrg )
     3040            treedrg,hice, tice, bilg_cumul, &
     3041            fcds, fcdi, dh_basal_growth, dh_basal_melt, &
     3042            dh_top_melt, dh_snow2sic, &
     3043            dtice_melt, dtice_snow2sic , &
     3044!GG
    29913045!FC
    29923046!AM
     
    35763630          ENDDO
    35773631
    3578           IF (iflag_wake==2) THEN
     3632          IF (mod(iflag_wake,10)==2) THEN
    35793633             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
    35803634             DO k = 1,klev
     
    35843638                     ok_wk_lsp(:)*(d_q_eva(:,k)+d_q_lsc(:,k))/phys_tstep
    35853639             ENDDO
    3586           ELSEIF (iflag_wake==3) THEN
     3640          ELSEIF (mod(iflag_wake,10)==3) THEN
    35873641             ok_wk_lsp(:)=max(sign(1.,wake_s(:)-wake_s_min_lsp),0.)
    35883642             DO k = 1,klev
     
    47464800               topsw0,toplw0,solsw0,sollw0, &
    47474801               lwdnc0, lwdn0, lwdn, lwupc0, lwup0, lwup,  &
     4802               lwtoa0b, lwtoab , &  !FC
    47484803               swdnc0, swdn0, swdn, swupc0, swup0, swup, &
    47494804               topswad_aero, solswad_aero, &
     
    47604815               ZLWFT0_i, ZFLDN0, ZFLUP0, &
    47614816               ZSWFT0_i, ZFSDN0, ZFSUP0, &
     4817               ZFLUX_DIR, ZFLUX_DIR_CLEAR, ZFLUX_DIR_SUN, &
    47624818               cloud_cover_sw, &
    47634819               !--AB contrails radiative effects
     
    48324888                     topsw0p,toplw0p,solsw0p,sollw0p, &
    48334889                     lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp,  &
     4890                     lwtoa0bp, lwtoabp , &  !FC
    48344891                     swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp, &
    48354892                     topswad_aerop, solswad_aerop, &
     
    48464903                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
    48474904                     ZSWFT0_i, ZFSDN0, ZFSUP0, &
     4905                     ZFLUX_DIR, ZFLUX_DIR_CLEAR, ZFLUX_DIR_SUN, &
    48484906                     cloud_cover_sw, &
    48494907                     !--AB contrails radiative effects
     
    48814939                     topsw0_s2,toplw0_s2,solsw0_s2,sollw0_s2, &
    48824940                     lwdnc0_s2, lwdn0_s2, lwdn_s2, lwupc0_s2, lwup0_s2, lwup_s2,  &
     4941                     lwtoa0b_s2, lwtoab_s2 , &  !FC
    48834942                     swdnc0_s2, swdn0_s2, swdn_s2, swupc0_s2, swup0_s2, swup_s2, &
    48844943                     topswad_aero_s2, solswad_aero_s2, &
     
    48954954                     ZLWFT0_i, ZFLDN0, ZFLUP0, &
    48964955                     ZSWFT0_i, ZFSDN0, ZFSUP0, &
     4956                     ZFLUX_DIR, ZFLUX_DIR_CLEAR, ZFLUX_DIR_SUN, &
    48974957                     cloud_cover_sw_s2)
    48984958          ENDIF ! ok_3Deffect
     
    51155175    IF (.not. ok_hines .and. ok_gwd_rando) then
    51165176       ! ym missing init for east_gwstress & west_gwstress -> added in phys_local_var_mod
     5177       CALL acama_GWD_rando_first()
    51175178       CALL acama_GWD_rando(PHYS_TSTEP, pplay, latitude_deg, t_seri, u_seri, &
    51185179            v_seri, rot, zustr_gwd_front, zvstr_gwd_front, du_gwd_front, &
     
    51335194
    51345195    IF (ok_gwd_rando) THEN
     5196       CALL FLOTT_GWD_rando_first()
    51355197       CALL FLOTT_GWD_rando(PHYS_TSTEP, pplay, t_seri, u_seri, v_seri, &
    51365198            rain_fall + snow_fall, zustr_gwd_rando, zvstr_gwd_rando, &
     
    52495311!            Additional tendency of TKE due to orography
    52505312!===============================================================
    5251 !
    5252 ! Inititialization
    5253 !------------------
    5254 
    5255        addtkeoro=0
    5256        CALL getin_p('addtkeoro',addtkeoro)
    5257 
    5258        IF (prt_level.ge.5) &
    5259             print*,'addtkeoro', addtkeoro
    5260 
    5261        alphatkeoro=1.
    5262        CALL getin_p('alphatkeoro',alphatkeoro)
    5263        alphatkeoro=min(max(0.,alphatkeoro),1.)
    5264 
    5265        smallscales_tkeoro=.FALSE.
    5266        CALL getin_p('smallscales_tkeoro',smallscales_tkeoro)
    5267 
    52685313
    52695314       dtadd(:,:)=0.
     
    55125557                      da,phi,phi2,d1a,dam,mp,ep,sigd,sij,clw,elij,         &
    55135558                      epmlmMm,eplaMm,upwd,dnwd,itop_con,ibas_con,          &
    5514                       ev,wdtrainA,  wdtrainM,wght_cvfd,                    &
     5559                      ev,wdtrainAS,  wdtrainM,wght_cvfd,                    &
    55155560                      fm_therm, entr_therm, rneb,                          &
    55165561                      beta_prec_fisrt,beta_prec,                           &
     
    57745819       ENDDO
    57755820    ENDDO
     5821
     5822    ! in case of advection of TKE
     5823    IF (ok_advtke) THEN
     5824      DO k=1,klev
     5825         DO i=1,klon
     5826           d_qx(i,k,itke)=((pbl_tke(i,k,is_ave)+pbl_tke(i,k+1,is_ave))/2. - qx(i,k,itke)) / phys_tstep
     5827         ENDDO
     5828      ENDDO
     5829    ENDIF
    57765830    !
    57775831    ! DC: All iterations are cycled if nqtot==nqo, so no nqtot>nqo condition required
     
    58055859    qtc_ancien(:,:)= qtc_seri(:,:)
    58065860    nic_ancien(:,:)= nic_seri(:,:)
     5861    tke_ancien(:,:)= pbl_tke(:,:,is_ave)
     5862
    58075863    CALL water_int(klon,klev,q_ancien,zmasse,prw_ancien)
    58085864    CALL water_int(klon,klev,ql_ancien,zmasse,prlw_ancien)
     
    59696025
    59706026    IF (lafin) THEN
     6027       CALL s2s_finalize     ! finalization of source to source tools
    59716028       itau_phy = itau_phy + itap
    59726029       CALL phyredem ("restartphy.nc")
Note: See TracChangeset for help on using the changeset viewer.