Ignore:
Timestamp:
Dec 16, 2017, 11:57:23 AM (6 years ago)
Author:
jyg
Message:

Bug fix: some communication variables between the
convective scheme and phytrac were set to zero at
the beginning of physiq (and others were not
saved) which led to an erroneous behaviour when
convection was not called at every time step. Now
all theses variables are in phys_local_var_mod and
are no longer reset to zero at the beginning of
physiq provided ok_bug_cv_trac=n .

If ok_bug_cv_trac=y, then the reset to zero is
still performed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/physiq_mod.F90

    r3123 r3134  
    165165       proba_notrig, random_notrig,  &
    166166       !
    167        dnwd, dnwd0,  &
    168        upwd, omega,  &
     167       dnwd0,  &
     168       omega,  &
    169169       epmax_diag,  &
     170
     171       !    Deep convective variables used in phytrac
     172       pmflxr, pmflxs,  &
     173       wdtrainA, wdtrainM,  &
     174       upwd, dnwd, &
    170175       ep,  &
     176       da, mp, &
     177       phi, &
     178       wght_cvfd, &
     179       phi2, &
     180       d1a, dam, &
     181       ev, &
     182       elij, &
     183       clw, &
     184       epmlmMm, eplaMm, &
     185       sij, &
     186
    171187       cldemi,  &
    172188       cldfra, cldtau, fiwc,  &
     
    181197       fsolsw, wfbils, wfbilo,  &
    182198       wfevap, wfrain, wfsnow,  & 
    183        pmflxr, pmflxs, prfl,  &
    184        psfl, fraca, Vprecip,  &
     199       prfl, psfl, fraca, Vprecip,  &
    185200       zw2,  &
    186201       
     
    192207       qwriteSTD, twriteSTD, rhwriteSTD, &    !pour calcul_STDlev.h
    193208       
    194        wdtrainA, wdtrainM,  &
    195209       beta_prec,  &
    196210       rneb,  &
     
    440454    REAL dtadd(klon,klev)
    441455
    442     ! Variables pour le transport convectif
    443     real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
    444     real wght_cvfd(klon,klev)
    445456#ifndef CPP_XIOS
    446457    REAL, SAVE :: missing_val=nf90_fill_real
    447458#endif
    448     ! Variables pour le lessivage convectif
    449     ! RomP >>>
    450     real phi2(klon,klev,klev)
    451     real d1a(klon,klev),dam(klon,klev)
    452     real ev(klon,klev)
    453     real clw(klon,klev),elij(klon,klev,klev)
    454     real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
    455     ! RomP <<<
     459!!   Variables moved to phys_local_var_mod
     460!!    ! Variables pour le transport convectif
     461!!    real da(klon,klev),phi(klon,klev,klev),mp(klon,klev)
     462!!    real wght_cvfd(klon,klev)
     463!!    ! Variables pour le lessivage convectif
     464!!    ! RomP >>>
     465!!    real phi2(klon,klev,klev)
     466!!    real d1a(klon,klev),dam(klon,klev)
     467!!    real ev(klon,klev)
     468!!    real clw(klon,klev),elij(klon,klev,klev)
     469!!    real epmlmMm(klon,klev,klev),eplaMm(klon,klev)
     470!!    ! RomP <<<
    456471    !IM definition dynamique o_trac dans phys_output_open
    457472    !      type(ctrl_out) :: o_trac(nqtot)
     
    543558    ! variables supplementaires de concvl
    544559    REAL Tconv(klon,klev)
    545     REAL sij(klon,klev,klev)
     560!!    variable moved to phys_local_var_mod
     561!!    REAL sij(klon,klev,klev)
    546562!!    !
    547563!!    ! variables pour tester la conservation de l'energie dans concvl
     
    868884    INTEGER :: flag_inhib_tend = 0 !  0 is the default value
    869885!!    INTEGER :: flag_inhib_tend = 2
     886    !
     887    ! Logical switch to a bug : reseting to 0 convective variables at the
     888    ! begining of physiq.
     889    LOGICAL, SAVE :: ok_bug_cv_trac = .TRUE.
     890    !$OMP THREADPRIVATE(ok_bug_cv_trac)
    870891
    871892    !
     
    12491270                                  ! in rrtm/suphec.F90 (and rvtmp2 is set to 0).
    12501271       CALL getin_p('ok_bad_ecmwf_thermo',ok_bad_ecmwf_thermo)
     1272       CALL getin_p('ok_bug_cv_trac',ok_bug_cv_trac)
    12511273       fl_ebil = 0 ! by default, conservation diagnostics are desactivated
    12521274       CALL getin_p('fl_ebil',fl_ebil)
     
    18861908       ENDDO
    18871909    ENDDO
    1888     da(:,:)=0.
    1889     mp(:,:)=0.
    1890     phi(:,:,:)=0.
    1891     ! RomP >>>
    1892     phi2(:,:,:)=0.
    18931910    beta_prec_fisrt(:,:)=0.
    18941911    beta_prec(:,:)=0.
    1895     epmlmMm(:,:,:)=0.
    1896     eplaMm(:,:)=0.
    1897     d1a(:,:)=0.
    1898     dam(:,:)=0.
    1899     pmflxr=0.
    1900     pmflxs=0.
    1901     ! RomP <<<
     1912    !
     1913    !   Output variables from the convective scheme should not be set to 0
     1914    !   since convection is not always called at every time step.
     1915    IF (ok_bug_cv_trac) THEN
     1916      da(:,:)=0.
     1917      mp(:,:)=0.
     1918      phi(:,:,:)=0.
     1919      ! RomP >>>
     1920      phi2(:,:,:)=0.
     1921      epmlmMm(:,:,:)=0.
     1922      eplaMm(:,:)=0.
     1923      d1a(:,:)=0.
     1924      dam(:,:)=0.
     1925      pmflxr(:,:)=0.
     1926      pmflxs(:,:)=0.
     1927      ! RomP <<<
     1928    ENDIF
    19021929
    19031930    !
     
    24622489    IF (MOD(itapcv,cvpas).EQ.0) THEN
    24632490
     2491    !
     2492    ! Mettre a zero des variables de sortie (pour securite)
     2493    !
     2494    pmflxr(:,:) = 0.
     2495    pmflxs(:,:) = 0.
     2496    wdtrainA(:,:) = 0.
     2497    wdtrainM(:,:) = 0.
     2498    upwd(:,:) = 0.
     2499    dnwd(:,:) = 0.
     2500    ep(:,:) = 0.
     2501    da(:,:)=0.
     2502    mp(:,:)=0.
     2503    wght_cvfd(:,:)=0.
     2504    phi(:,:,:)=0.
     2505    phi2(:,:,:)=0.
     2506    epmlmMm(:,:,:)=0.
     2507    eplaMm(:,:)=0.
     2508    d1a(:,:)=0.
     2509    dam(:,:)=0.
     2510    elij(:,:,:)=0.
     2511    ev(:,:)=0.
     2512    clw(:,:)=0.
     2513    sij(:,:,:)=0.
     2514    !
    24642515    IF (iflag_con.EQ.1) THEN
    24652516       abort_message ='reactiver le call conlmd dans physiq.F'
Note: See TracChangeset for help on using the changeset viewer.