Ignore:
Timestamp:
Jan 17, 2025, 6:16:25 PM (13 days ago)
Author:
aborella
Message:

Merge with trunk

Location:
LMDZ6/branches/contrails
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/branches/contrails

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

    r5488 r5489  
    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
     41    USE infotrac_phy, ONLY: nqtot, nbtr, nqo, tracers, type_trac, addPhase, ivap, iliq, isol, ibs, icf, irvc, ircont
    4242    USE strings_mod,  ONLY: strIdx
    4343    USE iophy
     
    7878    USE lmdz_lscp, ONLY : lscp
    7979    USE lmdz_call_cloud_optics_prop, ONLY : call_cloud_optics_prop
    80     USE lmdz_lscp_old, ONLY : fisrtilp
     80    USE lmdz_lscp_old, ONLY : fisrtilp, fisrtilp_first
    8181    USE lmdz_call_blowing_snow, ONLY : call_blowing_snow_sublim_sedim
    8282    USE lmdz_wake_ini, ONLY : wake_ini
     
    248248       cldh, cldl,cldm, cldq, cldt,      &
    249249       JrNt,                             &
    250        dthmin, evap, snowerosion,fder, plcl, plfc,   &
     250       dthmin, evap, snowerosion, icesub_lic, fder, plcl, plfc,   &
    251251       prw, prlw, prsw, prbsw, water_budget,         &
    252252       s_lcl, s_pblh, s_pblt, s_therm,   &
     
    376376       USE phys_output_write_spl_mod, ONLY: phys_output_write_spl
    377377       USE phytracr_spl_mod, ONLY: phytracr_spl_out_init, phytracr_spl
     378       USE s2s, ONLY : s2s_initialize
    378379    IMPLICIT NONE
    379380    !>======================================================================
     
    512513    !======================================================================
    513514    !
    514     ! indices de traceurs eau vapeur, liquide, glace, fraction nuageuse LS (optional), blowing snow (optional)
    515     INTEGER,SAVE :: ivap, iliq, isol, ibs, icf, irvc, ircont
    516 !$OMP THREADPRIVATE(ivap, iliq, isol, ibs, icf, irvc, ircont)
    517     !
    518515    !
    519516    ! Variables argument:
     
    10211018
    10221019    REAL picefra(klon,klev)
    1023     REAL zrel_oro(klon)
     1020    REAL nm_oro(klon)
    10241021    !IM cf. AM 081204 END
    10251022    !
     
    10961093    CHARACTER*80 abort_message
    10971094    LOGICAL, SAVE ::  ok_sync, ok_sync_omp
    1098     !$OMP THREADPRIVATE(ok_sync)
     1095    !$OMP THREADPRIVATE(ok_sync,ok_sync_omp)
    10991096    REAL date0
    11001097
     
    11061103    REAL ztsol(klon)
    11071104    REAL q2m(klon,nbsrf)  ! humidite a 2m
    1108     REAL fsnowerosion(klon,nbsrf) ! blowing snow flux at surface
    11091105    REAL qbsfra  ! blowing snow fraction
    11101106    !IM: t2m, q2m, ustar, u10m, v10m et t2mincels, t2maxcels
     
    12701266    ! Subgrid scale wind :
    12711267    ! Need to be allocatable/save because the number of bin is not known (provided by surf_wind_ini)
    1272     integer, save :: nsrfwnd=1
     1268    integer, save :: nsurfwind=1
    12731269    real, dimension(:,:), allocatable, save :: surf_wind_value, surf_wind_proba ! module and probability of sugrdi wind wind sample
    1274     !$OMP THREADPRIVATE(nsrfwnd,surf_wind_value, surf_wind_proba)
     1270    !$OMP THREADPRIVATE(nsurfwind,surf_wind_value, surf_wind_proba)
    12751271   
    12761272
     
    13521348
    13531349    IF (first) THEN
    1354        ivap = strIdx(tracers(:)%name, addPhase('H2O', 'g'))
    1355        iliq = strIdx(tracers(:)%name, addPhase('H2O', 'l'))
    1356        isol = strIdx(tracers(:)%name, addPhase('H2O', 's'))
    1357        ibs  = strIdx(tracers(:)%name, addPhase('H2O', 'b'))
    1358        icf  = strIdx(tracers(:)%name, addPhase('H2O', 'f'))
    1359        irvc = strIdx(tracers(:)%name, addPhase('H2O', 'c'))
    1360        ircont = strIdx(tracers(:)%name, addPhase('H2O', 'a'))
     1350       
     1351        CALL s2s_initialize     ! initialization of source to source tools
     1352       
    13611353!       CALL init_etat0_limit_unstruct
    13621354!       IF (.NOT. create_etat0_limit) CALL init_limit_read(days_elapsed)
     
    18411833!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    18421834       CALL surf_wind_ini(klon,lunout)
    1843        CALL getin_p('nsrfwnd',nsrfwnd)
    1844        allocate(surf_wind_value(klon,nsrfwnd),surf_wind_proba(klon,nsrfwnd))
     1835       CALL getin_p('nsurfwind',nsurfwind)
     1836       allocate(surf_wind_value(klon,nsurfwind),surf_wind_proba(klon,nsurfwind))
    18451837   
    18461838!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     1839   CALL iophys_ini(pdtphys,nsurfwind) ! replay automatic include  ! replay automatic include
    18471840       CALL wake_ini(rg,rd,rv,prt_level)
    18481841       CALL yamada_ini(klon,lunout,prt_level)
     
    29172910            cdragh,    cdragm,  u1,    v1,            &
    29182911            beta_aridity, &
    2919                                 !albedo SB >>>
    2920                                 ! albsol1,   albsol2,   sens,    evap,      &
    2921             albsol_dir,   albsol_dif,   sens,    evap, snowerosion, &
    2922                                 !albedo SB <<<
     2912            albsol_dir,   albsol_dif,   sens,    evap, snowerosion, icesub_lic, &
    29232913            albsol3_lic,runoff,   snowhgt,   qsnow, to_ice, sissnow, &
    29242914            zxtsol,    zxfluxlat, zt2m,    qsat2m,  zn2mout, &
     
    37363726             !  poches, la tendance moyenne associ\'ee doit etre
    37373727             !  multipliee par la fraction surfacique qu'ils couvrent.
     3728             IF (mod(iflag_pbl_split/10,10) == 1) THEN
     3729                ! On tient compte du splitting pour modifier les profils deltatq/T des poches
     3730                DO k=1,klev
     3731                   DO i=1,klon
     3732                      d_deltat_the(i,k) = - d_t_ajs(i,k)
     3733                      d_deltaq_the(i,k) = - d_q_ajs(i,k)
     3734                   ENDDO
     3735                ENDDO
     3736             ELSE
     3737                d_deltat_the(:,:) = 0.
     3738                d_deltaq_the(:,:) = 0.
     3739             ENDIF
     3740
    37383741             DO k=1,klev
    37393742                DO i=1,klon
    3740                    !
    3741                    d_deltat_the(i,k) = - d_t_ajs(i,k)
    3742                    d_deltaq_the(i,k) = - d_q_ajs(i,k)
    3743                    !
    37443743                   d_u_ajs(i,k) = d_u_ajs(i,k)*(1.-wake_s(i))
    37453744                   d_v_ajs(i,k) = d_v_ajs(i,k)*(1.-wake_s(i))
    37463745                   d_t_ajs(i,k) = d_t_ajs(i,k)*(1.-wake_s(i))
    37473746                   d_q_ajs(i,k) = d_q_ajs(i,k)*(1.-wake_s(i))
    3748                    !
    37493747                ENDDO
    37503748             ENDDO
     
    38373835    !===================================================================
    38383836    ! Computation of subrgid scale near-surface wind distribution
    3839     call surf_wind(klon,nsrfwnd,u10m,v10m,wake_s,wake_Cstar,ustar,wstar,surf_wind_value,surf_wind_proba)
     3837    call surf_wind(klon,nsurfwind,u10m,v10m,wake_s,wake_Cstar,ustar,wstar,surf_wind_value,surf_wind_proba)
    38403838
    38413839    !===================================================================
     
    39243922
    39253923    ELSE
    3926 
     3924   
     3925    CALL fisrtilp_first(klon, klev, phys_tstep, pfrac_impa, pfrac_nucl, pfrac_1nucl)
    39273926    CALL fisrtilp(klon,klev,phys_tstep,paprs,pplay, &
    39283927         t_seri, q_seri,ptconv,ratqs,sigma_qtherm, &
     
    48594858    ! a l'echelle sous-maille:
    48604859    !
     4860
     4861    ! calculation of nm_oro
     4862    DO i=1,klon
     4863          ! nm_oro is a proxy for the number of subgrid scale mountains
     4864          ! -> condition on nm_oro can deactivate the lifting on tilted planar terrains
     4865          !    such as ice sheets (work by V. Wiener)
     4866          ! in such a case, the SSO scheme should activate only where nm_oro>0 i.e. by setting
     4867          ! nm_oro_t=0.
     4868          nm_oro(i)=zsig(i)*sqrt(cell_area(i)*(pctsrf(i,is_ter)+pctsrf(i,is_lic)))/(4.*MAX(zstd(i),1.e-8))-1.
     4869    ENDDO
     4870
    48614871    IF (prt_level .GE.10) THEN
    48624872       print *,' call orography ? ', ok_orodr
     
    48694879       DO i=1,klon
    48704880          itest(i)=0
    4871           zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
    4872           !zrel_oro: relative mountain height wrt relief explained by mean slope
    4873           ! -> condition on zrel_oro can deactivate the drag on tilted planar terrains
    4874           !    such as ice sheets (work by V. Wiener)
    48754881          ! zpmm_orodr_t and zstd_orodr_t are activation thresholds set by F. Lott to
    48764882          ! earn computation time but they are not physical.
    4877           IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
     4883          IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
    48784884             itest(i)=1
    48794885             igwd=igwd+1
     
    49244930       DO i=1,klon
    49254931          itest(i)=0
    4926           !zrel_oro: relative mountain height wrt relief explained by mean slope
    4927           ! -> condition on zrel_oro can deactivate the lifting on tilted planar terrains
    4928           !    such as ice sheets (work by V. Wiener)
    4929           zrel_oro(i)=zstd(i)/(max(zsig(i),1.E-8)*sqrt(cell_area(i)))
    4930           IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
     4932          IF (((zpic(i)-zmea(i)).GT.zpmm_orolf_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
    49314933             itest(i)=1
    49324934             igwd=igwd+1
     
    51695171! car on peut s'attendre a ce que les petites echelles produisent aussi de la TKE
    51705172! Mais attention, cela ne va pas dans le sens de la conservation de l'energie!
    5171           IF ((zstd(i).GT.1.0) .AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
     5173          IF ((zstd(i).GT.1.0) .AND.(nm_oro(i).GT.nm_oro_t)) THEN
    51725174             itest(i)=1
    51735175             igwd=igwd+1
     
    51815183       DO i=1,klon
    51825184          itest(i)=0
    5183         IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(zrel_oro(i).LE.zrel_oro_t)) THEN
     5185        IF (((zpic(i)-zmea(i)).GT.zpmm_orodr_t).AND.(zstd(i).GT.zstd_orodr_t).AND.(nm_oro(i).GT.nm_oro_t)) THEN
    51845186             itest(i)=1
    51855187             igwd=igwd+1
Note: See TracChangeset for help on using the changeset viewer.