Changeset 3134 for LMDZ6/trunk/libf


Ignore:
Timestamp:
Dec 16, 2017, 11:57:23 AM (7 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.

Location:
LMDZ6/trunk/libf/phylmd
Files:
2 edited

Legend:

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

    r3124 r3134  
    392392      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
    393393!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
    394       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
    395 !$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
     394      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
     395!$OMP THREADPRIVATE(dnwd0, omega)
    396396      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
    397397!$OMP THREADPRIVATE(epmax_diag)
    398       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ep ! epmax_cape
     398!
     399!  Deep convective variables used in phytrac
     400      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
    399401!$OMP THREADPRIVATE(ep)
     402      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
     403!$OMP THREADPRIVATE(dnwd, upwd)
     404      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
     405!$OMP THREADPRIVATE(pmflxr, pmflxs)
     406      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainM
     407!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
     408      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
     409!$OMP THREADPRIVATE(da, mp)
     410      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
     411!$OMP THREADPRIVATE(wght_cvfd)
     412      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
     413!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
     414      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
     415!$OMP THREADPRIVATE(d1a, dam)
     416      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
     417!$OMP THREADPRIVATE(ev)
     418      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
     419!$OMP THREADPRIVATE(clw)
     420      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
     421!$OMP THREADPRIVATE(eplaMm)
     422      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
     423!$OMP THREADPRIVATE(sij)
     424!
    400425!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
    401426      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
     
    409434      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
    410435!$OMP THREADPRIVATE(zx_rh)
    411       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
    412 !$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
     436      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca
     437!$OMP THREADPRIVATE(prfl, psfl, fraca)
    413438      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
    414439!$OMP THREADPRIVATE(Vprecip, zw2)
     
    423448
    424449! ug et d'autres encore:
    425       REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
    426 !$OMP THREADPRIVATE(wdtrainA, wdtrainM)
    427450      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
    428451!$OMP THREADPRIVATE(beta_prec)
     
    719742      ALLOCATE(proba_notrig(klon), random_notrig(klon))
    720743
    721       ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
     744      ALLOCATE(dnwd0(klon, klev))
    722745!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
    723       ALLOCATE(upwd(klon, klev), omega(klon, klev))
     746      ALLOCATE(omega(klon, klev))
    724747      ALLOCATE(epmax_diag(klon)) ! epmax_cape
    725       ALLOCATE(ep(klon,klev)) ! epmax_cape
    726748!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
    727749      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
     
    738760      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
    739761      ALLOCATE(evap_pot(klon, nbsrf))
    740 
    741       ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
     762!
     763!  Deep convective variables used in phytrac
     764      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
     765      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
     766      ALLOCATE(dnwd(klon, klev), upwd(klon, klev) )
     767      ALLOCATE(ep(klon,klev))                          ! epmax_cape
     768      ALLOCATE(da(klon,klev), mp(klon,klev) )
     769      ALLOCATE(phi(klon,klev,klev) )
     770      ALLOCATE(wght_cvfd(klon,klev) )
     771      ALLOCATE(phi2(klon,klev,klev) )
     772      ALLOCATE(d1a(klon,klev), dam(klon,klev))
     773      ALLOCATE(ev(klon,klev) )
     774      ALLOCATE(elij(klon,klev,klev) )
     775      ALLOCATE(clw(klon,klev) )
     776      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
     777      ALLOCATE(sij(klon,klev,klev) )
     778
     779      ALLOCATE(prfl(klon, klev+1))
    742780      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
    743781      ALLOCATE(zw2(klon, klev+1))
     
    752790
    753791! ug et d'autres encore:
    754       ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
    755792      ALLOCATE(beta_prec(klon,klev))
    756793      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
     
    9961033      DEALLOCATE(proba_notrig, random_notrig)
    9971034
    998       DEALLOCATE(dnwd, dnwd0)
     1035      DEALLOCATE(dnwd0)
    9991036!      DEALLOCATE(upwd, omega, coefh)
    1000       DEALLOCATE(upwd, omega)
     1037      DEALLOCATE(omega)
    10011038      DEALLOCATE(epmax_diag)
    1002       DEALLOCATE(ep)
    10031039!      DEALLOCATE(coefm, lambda_th, cldemi)
    10041040      DEALLOCATE(lambda_th, cldemi)
     
    10151051      DEALLOCATE(wfevap,wfrain,wfsnow)
    10161052
    1017       DEALLOCATE(pmflxr, pmflxs, prfl)
    1018       DEALLOCATE(psfl, fraca, Vprecip)
     1053      DEALLOCATE(pmflxr, pmflxs)
     1054      DEALLOCATE(wdtrainA, wdtrainM)
     1055      DEALLOCATE(upwd, dnwd)
     1056      DEALLOCATE(ep)
     1057      DEALLOCATE(da, mp )
     1058      DEALLOCATE(phi )
     1059      DEALLOCATE(wght_cvfd )
     1060      DEALLOCATE(phi2 )
     1061      DEALLOCATE(d1a, dam)
     1062      DEALLOCATE(ev )
     1063      DEALLOCATE(elij )
     1064      DEALLOCATE(clw )
     1065      DEALLOCATE(epmlmMm, eplaMm )
     1066      DEALLOCATE(sij )
     1067
     1068
     1069      DEALLOCATE(prfl, psfl, fraca, Vprecip)
    10191070      DEALLOCATE(zw2)
    10201071
     
    10271078
    10281079! ug et d'autres encore:
    1029       DEALLOCATE(wdtrainA, wdtrainM)
    10301080      DEALLOCATE(beta_prec)
    10311081      DEALLOCATE(rneb)
  • 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.