1 | ! |
---|
2 | ! |
---|
3 | ! |
---|
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 | |
---|
24 | USE print_control_mod, ONLY: prt_level |
---|
25 | USE thermcell_mod, ONLY: RKAPPA |
---|
26 | USE watercommon_h, ONLY: RLvCp, RETV, Psat_water |
---|
27 | USE tracer_h, ONLY: igcm_h2o_vap, igcm_h2o_ice |
---|
28 | USE callkeys_mod, ONLY: water |
---|
29 | |
---|
30 | IMPLICIT NONE |
---|
31 | |
---|
32 | |
---|
33 | !=============================================================================== |
---|
34 | ! Declaration |
---|
35 | !=============================================================================== |
---|
36 | |
---|
37 | ! Inputs: |
---|
38 | ! ------- |
---|
39 | |
---|
40 | INTEGER ngrid, nlay, nq |
---|
41 | |
---|
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 |
---|
49 | |
---|
50 | ! Outputs: |
---|
51 | ! -------- |
---|
52 | |
---|
53 | REAL zqt(ngrid,nlay) ! qt environment |
---|
54 | REAL zql(ngrid,nlay) ! ql environment |
---|
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 |
---|
61 | |
---|
62 | ! Local: |
---|
63 | ! ------ |
---|
64 | |
---|
65 | INTEGER ig, l |
---|
66 | |
---|
67 | REAL psat ! Dummy argument for Psat_water() |
---|
68 | |
---|
69 | !=============================================================================== |
---|
70 | ! Initialization |
---|
71 | !=============================================================================== |
---|
72 | |
---|
73 | zu(:,:) = pu(:,:) |
---|
74 | zv(:,:) = pv(:,:) |
---|
75 | |
---|
76 | zhl(:,:) = pt(:,:) / zpopsk(:,:) |
---|
77 | |
---|
78 | zqt(:,:) = pq(:,:,igcm_h2o_vap) |
---|
79 | zql(:,:) = 0. |
---|
80 | |
---|
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 |
---|
91 | ENDDO |
---|
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(:,:) |
---|
105 | ztv(:,:) = pt(:,:) / zpopsk(:,:) |
---|
106 | |
---|
107 | ENDIF |
---|
108 | |
---|
109 | |
---|
110 | RETURN |
---|
111 | END |
---|