[2060] | 1 | ! |
---|
| 2 | ! |
---|
| 3 | ! |
---|
[2127] | 4 | SUBROUTINE thermcell_env(ngrid,nlay,nq,pq,pt,pu,pv,pplay,pplev, & |
---|
| 5 | zqt,zql,zt,ztv,zhl,zu,zv,zpopsk,zqs) |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | !=============================================================================== |
---|
| 9 | ! Purpose: calcul des caracteristiques de l'environnement necessaires au calcul |
---|
| 10 | ! des proprietes dans le thermique. |
---|
| 11 | ! |
---|
| 12 | ! Modif 2019/04 (AB alexandre.boissinot@lmd.jussieu.fr) |
---|
| 13 | ! |
---|
| 14 | ! Nota Bene |
---|
| 15 | ! ql means "non-gaseous water mass mixing ratio" (liquid and solid) |
---|
| 16 | ! qv means "vapor mass mixing ratio" |
---|
| 17 | ! qt means "total water mass mixing ratio" |
---|
| 18 | ! TP means "potential temperature" |
---|
| 19 | ! TRPV means "virtual potential temperature with latent heat release" |
---|
| 20 | ! TPV means "virtual potential temperature" |
---|
| 21 | ! TR means "temperature with latent heat release" |
---|
| 22 | !=============================================================================== |
---|
| 23 | |
---|
[2060] | 24 | USE print_control_mod, ONLY: prt_level |
---|
| 25 | USE thermcell_mod, ONLY: RKAPPA |
---|
[2071] | 26 | USE watercommon_h, ONLY: RLvCp, RETV, Psat_water |
---|
[2127] | 27 | USE tracer_h, ONLY: igcm_h2o_vap, igcm_h2o_ice |
---|
| 28 | USE callkeys_mod, ONLY: water |
---|
[2060] | 29 | |
---|
[2127] | 30 | IMPLICIT NONE |
---|
[2060] | 31 | |
---|
[2127] | 32 | |
---|
| 33 | !=============================================================================== |
---|
[2060] | 34 | ! Declaration |
---|
[2127] | 35 | !=============================================================================== |
---|
[2060] | 36 | |
---|
[2127] | 37 | ! Inputs: |
---|
| 38 | ! ------- |
---|
[2060] | 39 | |
---|
[2127] | 40 | INTEGER ngrid, nlay, nq |
---|
[2060] | 41 | |
---|
[2127] | 42 | REAL pq(ngrid,nlay,nq) ! Large scale water |
---|
| 43 | REAL pt(ngrid,nlay) ! Large scale temperature |
---|
| 44 | REAL pu(ngrid,nlay) ! Large scale zonal wind |
---|
| 45 | REAL pv(ngrid,nlay) ! Large scale meridional wind |
---|
| 46 | REAL pplay(ngrid,nlay) ! Layers pressure |
---|
| 47 | REAL pplev(ngrid,nlay+1) ! Levels pressure |
---|
| 48 | REAL zpopsk(ngrid,nlay) ! Exner function |
---|
[2060] | 49 | |
---|
[2127] | 50 | ! Outputs: |
---|
| 51 | ! -------- |
---|
[2060] | 52 | |
---|
[2143] | 53 | REAL zqt(ngrid,nlay) ! qt environment |
---|
| 54 | REAL zql(ngrid,nlay) ! ql environment |
---|
[2127] | 55 | REAL zt(ngrid,nlay) ! T environment |
---|
| 56 | REAL ztv(ngrid,nlay) ! TRPV environment |
---|
| 57 | REAL zhl(ngrid,nlay) ! TP environment |
---|
| 58 | REAL zu(ngrid,nlay) ! u environment |
---|
| 59 | REAL zv(ngrid,nlay) ! v environment |
---|
| 60 | REAL zqs(ngrid,nlay) ! qsat environment |
---|
[2060] | 61 | |
---|
[2127] | 62 | ! Local: |
---|
| 63 | ! ------ |
---|
[2060] | 64 | |
---|
[2127] | 65 | INTEGER ig, l |
---|
[2060] | 66 | |
---|
[2127] | 67 | REAL psat ! Dummy argument for Psat_water() |
---|
[2060] | 68 | |
---|
[2127] | 69 | !=============================================================================== |
---|
[2060] | 70 | ! Initialization |
---|
[2127] | 71 | !=============================================================================== |
---|
[2060] | 72 | |
---|
[2127] | 73 | zu(:,:) = pu(:,:) |
---|
| 74 | zv(:,:) = pv(:,:) |
---|
[2060] | 75 | |
---|
[2127] | 76 | zhl(:,:) = pt(:,:) / zpopsk(:,:) |
---|
[2060] | 77 | |
---|
[2143] | 78 | zqt(:,:) = pq(:,:,igcm_h2o_vap) |
---|
| 79 | zql(:,:) = 0. |
---|
| 80 | |
---|
[2127] | 81 | !=============================================================================== |
---|
| 82 | ! Condensation and latent heat release |
---|
| 83 | !=============================================================================== |
---|
| 84 | |
---|
| 85 | IF (water) THEN |
---|
| 86 | |
---|
| 87 | DO l=1,nlay |
---|
| 88 | DO ig=1,ngrid |
---|
| 89 | CALL Psat_water(pt(ig,l), pplev(ig,l), psat, zqs(ig,l)) |
---|
| 90 | ENDDO |
---|
[2060] | 91 | ENDDO |
---|
[2127] | 92 | |
---|
| 93 | DO l=1,nlay |
---|
| 94 | DO ig=1,ngrid |
---|
| 95 | zql(ig,l) = max(0.,pq(ig,l,igcm_h2o_vap) - zqs(ig,l)) |
---|
| 96 | zt(ig,l) = pt(ig,l) + RLvCp * zql(ig,l) |
---|
| 97 | ztv(ig,l) = zt(ig,l) / zpopsk(ig,l) & |
---|
| 98 | & * (1. + RETV * (zqt(ig,l)-zql(ig,l)) - zql(ig,l)) |
---|
| 99 | ENDDO |
---|
| 100 | ENDDO |
---|
| 101 | |
---|
| 102 | ELSE |
---|
| 103 | |
---|
| 104 | zt(:,:) = pt(:,:) |
---|
[2143] | 105 | ztv(:,:) = pt(:,:) / zpopsk(:,:) |
---|
[2127] | 106 | |
---|
| 107 | ENDIF |
---|
[2060] | 108 | |
---|
| 109 | |
---|
| 110 | RETURN |
---|
| 111 | END |
---|