1 | ! |
---|
2 | ! $Id: phys_state_var_mod.F90 1670 2012-10-17 08:42:04Z idelkadi $ |
---|
3 | ! |
---|
4 | MODULE phys_state_var_mod |
---|
5 | ! Variables sauvegardees pour le startphy.nc |
---|
6 | !====================================================================== |
---|
7 | ! |
---|
8 | ! |
---|
9 | !====================================================================== |
---|
10 | ! Declaration des variables |
---|
11 | USE dimphy, only : klon,klev |
---|
12 | use comchem_h, only: nkim |
---|
13 | USE callkeys_mod, only: callchim |
---|
14 | USE comsoil_h, only : nsoilmx |
---|
15 | use comsaison_h, only: mu0, fract |
---|
16 | use radcommon_h, only: gzlat, gzlat_ig, Cmk |
---|
17 | USE radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind |
---|
18 | use surfdat_h, only: phisfi, albedodat, & |
---|
19 | zmea, zstd, zsig, zgam, zthe |
---|
20 | use turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th |
---|
21 | |
---|
22 | real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K) |
---|
23 | ! Useful for Dynamical Heating calculation. |
---|
24 | real,allocatable,dimension(:,:),save :: zuprevious |
---|
25 | !$OMP THREADPRIVATE(ztprevious,zuprevious) |
---|
26 | |
---|
27 | real, dimension(:),allocatable,save :: tsurf ! Surface temperature (K). |
---|
28 | real, dimension(:,:),allocatable,save :: tsoil ! Sub-surface temperatures (K). |
---|
29 | real, dimension(:,:),allocatable,save :: albedo ! Surface Spectral albedo. By MT2015. |
---|
30 | real, dimension(:),allocatable,save :: albedo_equivalent ! Spectral Mean albedo. |
---|
31 | |
---|
32 | !$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent) |
---|
33 | |
---|
34 | real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015. |
---|
35 | |
---|
36 | !$OMP THREADPRIVATE(albedo_bareground) |
---|
37 | |
---|
38 | real, dimension(:), allocatable, save :: tankCH4 ! Depth of surface methane tank (m) |
---|
39 | !$OMP THREADPRIVATE(tankCH4) |
---|
40 | |
---|
41 | real,dimension(:),allocatable,save :: emis ! Thermal IR surface emissivity. |
---|
42 | real,dimension(:,:),allocatable,save :: dtrad ! Net atmospheric radiative heating rate (K.s-1). |
---|
43 | real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2). |
---|
44 | real,dimension(:),allocatable,save :: fluxrad ! Net radiative surface flux (W.m-2). |
---|
45 | real,dimension(:),allocatable,save :: capcal ! Surface heat capacity (J m-2 K-1). |
---|
46 | real,dimension(:),allocatable,save :: fluxgrd ! Surface conduction flux (W.m-2). |
---|
47 | real,dimension(:,:),allocatable,save :: qsurf ! Tracer on surface (e.g. kg.m-2). |
---|
48 | !$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf) |
---|
49 | |
---|
50 | ! FOR DIAGNOSTIC : |
---|
51 | |
---|
52 | real,dimension(:),allocatable,save :: fluxsurf_lw ! Incident Long Wave (IR) surface flux (W.m-2). |
---|
53 | real,dimension(:),allocatable,save :: fluxsurf_sw ! Incident Short Wave (stellar) surface flux (W.m-2). |
---|
54 | real,dimension(:),allocatable,save :: fluxsurfabs_sw ! Absorbed Short Wave (stellar) flux by the surface (W.m-2). |
---|
55 | !$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw) |
---|
56 | |
---|
57 | real,dimension(:),allocatable,save :: fluxtop_lw ! Outgoing LW (IR) flux to space (W.m-2). |
---|
58 | real,dimension(:),allocatable,save :: fluxabs_sw ! Absorbed SW (stellar) flux (W.m-2). |
---|
59 | real,dimension(:),allocatable,save :: fluxtop_dn ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2). |
---|
60 | real,dimension(:),allocatable,save :: fluxdyn ! Horizontal heat transport by dynamics (W.m-2). |
---|
61 | !$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn) |
---|
62 | |
---|
63 | real,dimension(:,:),allocatable,save :: OLR_nu ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)). |
---|
64 | real,dimension(:,:),allocatable,save :: OSR_nu ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)). |
---|
65 | real,dimension(:,:),allocatable,save :: zdtlw ! LW heating tendencies (K/s). |
---|
66 | real,dimension(:,:),allocatable,save :: zdtsw ! SW heating tendencies (K/s). |
---|
67 | !real,dimension(:),allocatable,save :: sensibFlux ! Turbulent flux given by the atmosphere to the surface (W.m-2). |
---|
68 | !$OMP THREADPRIVATE(OLR_nu,OSR_nu,zdtlw,zdtsw) |
---|
69 | |
---|
70 | real,dimension(:,:,:),allocatable,save :: int_dtauv ! VI optical thickness of layers within narrowbands for diags (). |
---|
71 | real,dimension(:,:,:),allocatable,save :: int_dtaui ! IR optical thickness of layers within narrowbands for diags (). |
---|
72 | !$OMP THREADPRIVATE(int_dtaui,int_dtauv) |
---|
73 | |
---|
74 | real,dimension(:,:,:,:),allocatable,save :: zpopthi ! IR optical properties [haze] within narrowbands for diags (dtau,tau,k,wbar,gbar,drayaer,taugaz,dcont). |
---|
75 | real,dimension(:,:,:,:),allocatable,save :: zpopthv ! VI optical properties [haze] within narrowbands for diags (dtau,tau,k,wbar,gbar,drayaer,taugaz,dcont). |
---|
76 | real,dimension(:,:,:,:),allocatable,save :: zpoptti ! IR optical properties [haze+clouds] within narrowbands for diags (dtau,tau,k,wbar,gbar,drayaer,taugaz,dcont). |
---|
77 | real,dimension(:,:,:,:),allocatable,save :: zpopttv ! VI optical properties [haze+clouds] within narrowbands for diags (dtau,tau,k,wbar,gbar,drayaer,taugaz,dcont). |
---|
78 | !$OMP THREADPRIVATE(zpopthi,zpopthv,zpoptti,zpopttv) |
---|
79 | |
---|
80 | real,dimension(:,:),allocatable,save :: u_ref ! Reference profile for the zonal wind nudging (m.s-1). |
---|
81 | !$OMP THREADPRIVATE(u_ref) |
---|
82 | |
---|
83 | real,allocatable,dimension(:,:),save :: qsurf_hist |
---|
84 | !$OMP THREADPRIVATE(qsurf_hist) |
---|
85 | |
---|
86 | ! For chemistry |
---|
87 | real, dimension(:,:,:), allocatable, save :: dycchi ! NB : Only for chem tracers. Saved since chemistry is not called every step. |
---|
88 | !$OMP THREADPRIVATE(dycchi) |
---|
89 | |
---|
90 | CONTAINS |
---|
91 | |
---|
92 | !====================================================================== |
---|
93 | SUBROUTINE phys_state_var_init(nqtot) |
---|
94 | |
---|
95 | IMPLICIT NONE |
---|
96 | |
---|
97 | integer,intent(in) :: nqtot |
---|
98 | |
---|
99 | ! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM): |
---|
100 | ! |
---|
101 | !zmea(:) ! orographie moyenne |
---|
102 | !zstd(:) ! deviation standard de l'OESM |
---|
103 | !zsig(:) ! pente de l'OESM |
---|
104 | !zgam(:) ! anisotropie de l'OESM |
---|
105 | !zthe(:) ! orientation de l'OESM |
---|
106 | !zpic(:) ! Maximum de l'OESM |
---|
107 | !zval(:) ! Minimum de l'OESM |
---|
108 | !rugoro(:) ! longueur de rugosite de l'OESM |
---|
109 | print*,'klon',klon,'klev',klev |
---|
110 | ALLOCATE(tsurf(klon)) |
---|
111 | ALLOCATE(tsoil(klon,nsoilmx)) |
---|
112 | ALLOCATE(albedo(klon,L_NSPECTV)) |
---|
113 | ALLOCATE(albedo_equivalent(klon)) |
---|
114 | ALLOCATE(albedo_bareground(klon)) |
---|
115 | ALLOCATE(emis(klon)) |
---|
116 | ALLOCATE(dtrad(klon,klev)) |
---|
117 | ALLOCATE(fluxrad_sky(klon)) |
---|
118 | ALLOCATE(fluxrad(klon)) |
---|
119 | ALLOCATE(capcal(klon)) |
---|
120 | ALLOCATE(fluxgrd(klon)) |
---|
121 | ALLOCATE(qsurf(klon,nqtot)) |
---|
122 | ALLOCATE(q2(klon,klev+1)) |
---|
123 | ALLOCATE(tankCH4(klon)) |
---|
124 | ALLOCATE(ztprevious(klon,klev)) |
---|
125 | ALLOCATE(zuprevious(klon,klev)) |
---|
126 | ALLOCATE(qsurf_hist(klon,nqtot)) |
---|
127 | ALLOCATE(fluxsurf_lw(klon)) |
---|
128 | ALLOCATE(fluxsurf_sw(klon)) |
---|
129 | ALLOCATE(fluxsurfabs_sw(klon)) |
---|
130 | ALLOCATE(fluxtop_lw(klon)) |
---|
131 | ALLOCATE(fluxabs_sw(klon)) |
---|
132 | ALLOCATE(fluxtop_dn(klon)) |
---|
133 | ALLOCATE(fluxdyn(klon)) |
---|
134 | ALLOCATE(OLR_nu(klon,L_NSPECTI)) |
---|
135 | ALLOCATE(OSR_nu(klon,L_NSPECTV)) |
---|
136 | ALLOCATE(sensibFlux(klon)) |
---|
137 | ALLOCATE(zdtlw(klon,klev)) |
---|
138 | ALLOCATE(zdtsw(klon,klev)) |
---|
139 | ALLOCATE(int_dtaui(klon,klev,L_NSPECTI)) |
---|
140 | ALLOCATE(int_dtauv(klon,klev,L_NSPECTV)) |
---|
141 | ALLOCATE(zpopthi(klon,klev,L_NSPECTI,8)) |
---|
142 | ALLOCATE(zpopthv(klon,klev,L_NSPECTV,8)) |
---|
143 | ALLOCATE(zpoptti(klon,klev,L_NSPECTI,8)) |
---|
144 | ALLOCATE(zpopttv(klon,klev,L_NSPECTV,8)) |
---|
145 | ALLOCATE(u_ref(49,24)) |
---|
146 | allocate(dycchi(klon,klev,nkim)) |
---|
147 | ! This is defined in comsaison_h |
---|
148 | ALLOCATE(mu0(klon)) |
---|
149 | ALLOCATE(fract(klon)) |
---|
150 | ! This is defined in radcommon_h |
---|
151 | ALLOCATE(gzlat(klon,klev)) |
---|
152 | ALLOCATE(gzlat_ig(klev)) |
---|
153 | ALLOCATE(Cmk(klev)) |
---|
154 | ! This is defined in surfdat_h |
---|
155 | ALLOCATE(albedodat(klon)) |
---|
156 | ALLOCATE(phisfi(klon)) |
---|
157 | ALLOCATE(zmea(klon)) |
---|
158 | ALLOCATE(zstd(klon)) |
---|
159 | ALLOCATE(zsig(klon)) |
---|
160 | ALLOCATE(zgam(klon)) |
---|
161 | ALLOCATE(zthe(klon)) |
---|
162 | ! This is defined in turb_mod |
---|
163 | allocate(wstar(klon)) |
---|
164 | allocate(ustar(klon)) |
---|
165 | allocate(tstar(klon)) |
---|
166 | allocate(hfmax_th(klon)) |
---|
167 | allocate(zmax_th(klon)) |
---|
168 | |
---|
169 | END SUBROUTINE phys_state_var_init |
---|
170 | |
---|
171 | !====================================================================== |
---|
172 | SUBROUTINE phys_state_var_end |
---|
173 | |
---|
174 | IMPLICIT NONE |
---|
175 | |
---|
176 | DEALLOCATE(tsurf) |
---|
177 | DEALLOCATE(tsoil) |
---|
178 | DEALLOCATE(albedo) |
---|
179 | DEALLOCATE(albedo_equivalent) |
---|
180 | DEALLOCATE(albedo_bareground) |
---|
181 | DEALLOCATE(emis) |
---|
182 | DEALLOCATE(dtrad) |
---|
183 | DEALLOCATE(fluxrad_sky) |
---|
184 | DEALLOCATE(fluxrad) |
---|
185 | DEALLOCATE(capcal) |
---|
186 | DEALLOCATE(fluxgrd) |
---|
187 | DEALLOCATE(qsurf) |
---|
188 | DEALLOCATE(q2) |
---|
189 | DEALLOCATE(tankCH4) |
---|
190 | DEALLOCATE(ztprevious) |
---|
191 | DEALLOCATE(zuprevious) |
---|
192 | DEALLOCATE(qsurf_hist) |
---|
193 | DEALLOCATE(fluxsurf_lw) |
---|
194 | DEALLOCATE(fluxsurf_sw) |
---|
195 | DEALLOCATE(fluxsurfabs_sw) |
---|
196 | DEALLOCATE(fluxtop_lw) |
---|
197 | DEALLOCATE(fluxabs_sw) |
---|
198 | DEALLOCATE(fluxtop_dn) |
---|
199 | DEALLOCATE(fluxdyn) |
---|
200 | DEALLOCATE(OLR_nu) |
---|
201 | DEALLOCATE(OSR_nu) |
---|
202 | DEALLOCATE(sensibFlux) |
---|
203 | DEALLOCATE(zdtlw) |
---|
204 | DEALLOCATE(zdtsw) |
---|
205 | DEALLOCATE(int_dtaui) |
---|
206 | DEALLOCATE(int_dtauv) |
---|
207 | DEALLOCATE(zpopthi) |
---|
208 | DEALLOCATE(zpopthv) |
---|
209 | DEALLOCATE(zpoptti) |
---|
210 | DEALLOCATE(zpopttv) |
---|
211 | DEALLOCATE(u_ref) |
---|
212 | DEALLOCATE(dycchi) |
---|
213 | DEALLOCATE(mu0) |
---|
214 | DEALLOCATE(fract) |
---|
215 | DEALLOCATE(gzlat) |
---|
216 | DEALLOCATE(gzlat_ig) |
---|
217 | DEALLOCATE(Cmk) |
---|
218 | DEALLOCATE(phisfi) |
---|
219 | DEALLOCATE(albedodat) |
---|
220 | DEALLOCATE(zmea) |
---|
221 | DEALLOCATE(zstd) |
---|
222 | DEALLOCATE(zsig) |
---|
223 | DEALLOCATE(zgam) |
---|
224 | DEALLOCATE(zthe) |
---|
225 | deallocate(wstar) |
---|
226 | deallocate(ustar) |
---|
227 | deallocate(tstar) |
---|
228 | deallocate(hfmax_th) |
---|
229 | deallocate(zmax_th) |
---|
230 | |
---|
231 | |
---|
232 | END SUBROUTINE phys_state_var_end |
---|
233 | |
---|
234 | END MODULE phys_state_var_mod |
---|