source: trunk/LMDZ.PLUTO/libf/phypluto/phys_state_var_mod.F90 @ 3607

Last change on this file since 3607 was 3572, checked in by debatzbr, 3 weeks ago

Remove generic_aerosols and generic_condensation, along with their related variables (useless). RENAME THE VARIABLE AEROHAZE TO OPTICHAZE.

File size: 11.3 KB
Line 
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 comsoil_h, only : nsoilmx
13      use comsaison_h, only: mu0, fract
14      use radcommon_h, only: glat
15      USE radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind
16      use surfdat_h, only: phisfi, albedodat,  &
17                        zmea, zstd, zsig, zgam, zthe
18      use turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th
19
20      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
21! Useful for Dynamical Heating calculation.
22      real,allocatable,dimension(:,:),save :: zuprevious
23!$OMP THREADPRIVATE(ztprevious,zuprevious)
24
25      real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
26      real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
27      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
28      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
29      real, dimension(:),allocatable,save :: albedo_equivalent1     ! Spectral Mean albedo clear sky.
30      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
31      real, dimension(:),allocatable,save :: albedo_n2_ice_SPECTV ! N2 ice Spectral albedo.
32!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_equivalent1,albedo_snow_SPECTV,albedo_n2_ice_SPECTV)
33
34      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
35!$OMP THREADPRIVATE(albedo_bareground)
36
37      real,dimension(:),allocatable,save :: emis        ! Thermal IR surface emissivity.
38      real,dimension(:,:),allocatable,save :: dtrad     ! Net atmospheric radiative heating rate (K.s-1).
39      real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2).
40      real,dimension(:),allocatable,save :: fluxrad     ! Net radiative surface flux (W.m-2).
41      real,dimension(:),allocatable,save :: capcal      ! Surface heat capacity (J m-2 K-1).
42      real,dimension(:),allocatable,save :: fluxgrd     ! Surface conduction flux (W.m-2).
43      real,dimension(:,:),allocatable,save :: qsurf     ! Tracer on surface (e.g. kg.m-2).
44!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf)
45
46      ! FOR DIAGNOSTIC :
47
48      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
49      real,dimension(:),allocatable,save :: fluxsurf_lw1     ! Incident Long Wave (IR) surface flux (W.m-2) clear sky.
50      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
51      real,dimension(:),allocatable,save :: fluxsurf_sw1     ! Incident Short Wave (stellar) surface flux (W.m-2) clear sky.
52      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
53!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_lw1,fluxsurf_sw,fluxsurf_sw1,fluxsurfabs_sw)
54
55      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
56      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
57      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
58      real,dimension(:),allocatable,save :: fluxabs_sw1      ! Absorbed SW (stellar) flux (W.m-2) clear sky.
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,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,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 :: GSR_nu        ! Surface SW (or 'Ground' SW) radiation in each band (Normalized to the band width (W/m2/cm-1)).
66      real,dimension(:,:),allocatable,save :: zdtlw         ! LW heating tendencies (K/s).
67      real,dimension(:,:),allocatable,save :: zdtsw         ! SW heating tendencies (K/s).
68      !real,dimension(:),allocatable,save :: sensibFlux      ! Turbulent flux given by the atmosphere to the surface (W.m-2).
69!$OMP THREADPRIVATE(OLR_nu,OSR_nu,GSR_nu,zdtlw,zdtsw)
70
71      real,dimension(:,:,:),allocatable,save :: int_dtauv   ! VI optical thickness of layers within narrowbands for diags ().
72      real,dimension(:,:,:),allocatable,save :: int_dtaui   ! IR optical thickness of layers within narrowbands for diags ().
73!$OMP THREADPRIVATE(int_dtaui,int_dtauv)
74
75      real,allocatable,dimension(:),save :: tau_col ! Total Aerosol Optical Depth.
76!$OMP THREADPRIVATE(tau_col)
77
78      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
79      real,allocatable,dimension(:,:,:),save :: reffrad
80
81      real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
82      real,dimension(:),allocatable,save :: dEdiff      ! Integrated turbulent diffusion heating (W.m-2)
83      real,dimension(:),allocatable,save :: dEdiffs
84      real,dimension(:,:),allocatable,save :: dEzRadsw  ! Radiative heating (W.m-2)
85      real,dimension(:,:),allocatable,save :: dEzRadlw  ! Radiative heating (W.m-2)
86!$OMP THREADPRIVATE(dEzdiff,dEdiff,dEdiffs,dEzRadsw,dEzRadlw)
87
88      real,dimension(:),allocatable,save :: madjdE      ! Heat from moistadj (W.m-2)
89      real,dimension(:,:),allocatable,save :: madjdEz   ! Heat from moistadj (W.m-2)
90      real,dimension(:),allocatable,save :: lscaledE    ! Heat from largescale (W.m-2)
91      real,dimension(:,:),allocatable,save :: lscaledEz ! Heat from largescale (W.m-2)
92!$OMP THREADPRIVATE(madjdE,madjdEz,lscaledE,lscaledEz)
93
94      real,dimension(:),allocatable,save :: genericconddE ! Heat from generic condensation (W.m-2)
95!$OMP THREADPRIVATE(genericconddE)
96
97CONTAINS
98
99!======================================================================
100SUBROUTINE phys_state_var_init(nqtot)
101
102IMPLICIT NONE
103
104        integer,intent(in) :: nqtot
105
106!  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
107!
108!zmea(:)   ! orographie moyenne
109!zstd(:)   ! deviation standard de l'OESM
110!zsig(:)   ! pente de l'OESM
111!zgam(:)   ! anisotropie de l'OESM
112!zthe(:)   ! orientation de l'OESM
113!zpic(:)   ! Maximum de l'OESM
114!zval(:)   ! Minimum de l'OESM
115!rugoro(:) ! longueur de rugosite de l'OESM
116
117        ALLOCATE(phisfi(klon))
118        ALLOCATE(tsurf(klon))
119        ALLOCATE(tsoil(klon,nsoilmx))
120        ALLOCATE(albedo(klon,L_NSPECTV))
121        ALLOCATE(albedo_equivalent(klon))
122        ALLOCATE(albedo_equivalent1(klon))
123        ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
124        ALLOCATE(albedo_n2_ice_SPECTV(L_NSPECTV))
125        ALLOCATE(albedo_bareground(klon))
126        ALLOCATE(emis(klon))
127        ALLOCATE(dtrad(klon,klev))
128        ALLOCATE(fluxrad_sky(klon))
129        ALLOCATE(fluxrad(klon))
130        ALLOCATE(capcal(klon))
131        ALLOCATE(fluxgrd(klon))
132        ALLOCATE(qsurf(klon,nqtot))
133        ALLOCATE(q2(klon,klev+1))
134        ALLOCATE(ztprevious(klon,klev))
135        ALLOCATE(zuprevious(klon,klev))
136        ALLOCATE(reffrad(klon,klev,naerkind))
137        ALLOCATE(nueffrad(klon,klev,naerkind))
138        ALLOCATE(fluxsurf_lw(klon))
139        ALLOCATE(fluxsurf_lw1(klon))
140        ALLOCATE(fluxsurf_sw(klon))
141        ALLOCATE(fluxsurf_sw1(klon))
142        ALLOCATE(fluxsurfabs_sw(klon))
143        ALLOCATE(fluxtop_lw(klon))
144        ALLOCATE(fluxtop_lw1(klon))
145        ALLOCATE(fluxabs_sw(klon))
146        ALLOCATE(fluxabs_sw1(klon))
147        ALLOCATE(fluxtop_dn(klon))
148        ALLOCATE(fluxdyn(klon))
149        ALLOCATE(OLR_nu(klon,L_NSPECTI))
150        ALLOCATE(OSR_nu(klon,L_NSPECTV))
151        ALLOCATE(GSR_nu(klon,L_NSPECTV))
152        ALLOCATE(int_dtaui(klon,klev,L_NSPECTI))
153        ALLOCATE(int_dtauv(klon,klev,L_NSPECTV))
154        ALLOCATE(sensibFlux(klon))
155        ALLOCATE(zdtlw(klon,klev))
156        ALLOCATE(zdtsw(klon,klev))
157        ALLOCATE(tau_col(klon))
158        ALLOCATE(dEzdiff(klon,klev))
159        ALLOCATE(dEdiff(klon))
160        ALLOCATE(dEdiffs(klon))
161        ALLOCATE(dEzRadsw(klon,klev))
162        ALLOCATE(dEzRadlw(klon,klev))
163        ALLOCATE(madjdE(klon))
164        ALLOCATE(madjdEz(klon,klev))
165        ALLOCATE(lscaledE(klon))
166        ALLOCATE(lscaledEz(klon,klev))
167        ALLOCATE(genericconddE(klon))
168        ! This is defined in comsaison_h
169        ALLOCATE(mu0(klon))
170        ALLOCATE(fract(klon))
171         ! This is defined in radcommon_h
172        ALLOCATE(glat(klon))
173        ALLOCATE(albedodat(klon))
174        ALLOCATE(zmea(klon))
175        ALLOCATE(zstd(klon))
176        ALLOCATE(zsig(klon))
177        ALLOCATE(zgam(klon))
178        ALLOCATE(zthe(klon))
179        !allocate(l0(klon))
180        allocate(wstar(klon))
181        allocate(ustar(klon))
182        allocate(tstar(klon))
183        allocate(hfmax_th(klon))
184        allocate(zmax_th(klon))
185END SUBROUTINE phys_state_var_init
186
187!======================================================================
188SUBROUTINE phys_state_var_end
189
190IMPLICIT NONE
191
192        DEALLOCATE(tsurf)
193        DEALLOCATE(tsoil)
194        DEALLOCATE(albedo)
195        DEALLOCATE(albedo_equivalent)
196        DEALLOCATE(albedo_equivalent1)
197        DEALLOCATE(albedo_snow_SPECTV)
198        DEALLOCATE(albedo_n2_ice_SPECTV)
199        DEALLOCATE(albedo_bareground)
200        DEALLOCATE(emis)
201        DEALLOCATE(dtrad)
202        DEALLOCATE(fluxrad_sky)
203        DEALLOCATE(fluxrad)
204        DEALLOCATE(capcal)
205
206        DEALLOCATE(fluxgrd)
207        DEALLOCATE(qsurf)
208        DEALLOCATE(q2)
209        DEALLOCATE(ztprevious)
210        DEALLOCATE(zuprevious)
211        DEALLOCATE(reffrad)
212        DEALLOCATE(nueffrad)
213        DEALLOCATE(fluxsurf_lw)
214        DEALLOCATE(fluxsurf_lw1)
215        DEALLOCATE(fluxsurf_sw)
216        DEALLOCATE(fluxsurf_sw1)
217        DEALLOCATE(fluxsurfabs_sw)
218        DEALLOCATE(fluxtop_lw)
219        DEALLOCATE(fluxtop_lw1)
220        DEALLOCATE(fluxabs_sw)
221        DEALLOCATE(fluxabs_sw1)
222        DEALLOCATE(fluxtop_dn)
223        DEALLOCATE(fluxdyn)
224        DEALLOCATE(OLR_nu)
225        DEALLOCATE(OSR_nu)
226        DEALLOCATE(GSR_nu)
227        DEALLOCATE(int_dtaui)
228        DEALLOCATE(int_dtauv)
229        DEALLOCATE(sensibFlux)
230        DEALLOCATE(zdtlw)
231        DEALLOCATE(zdtsw)
232        DEALLOCATE(tau_col)
233        DEALLOCATE(dEzdiff)
234        DEALLOCATE(dEdiff)
235        DEALLOCATE(dEdiffs)
236        DEALLOCATE(dEzRadsw)
237        DEALLOCATE(dEzRadlw)
238        DEALLOCATE(madjdE)
239        DEALLOCATE(madjdEz)
240        DEALLOCATE(lscaledE)
241        DEALLOCATE(lscaledEz)
242        DEALLOCATE(genericconddE)
243        DEALLOCATE(mu0)
244        DEALLOCATE(fract)
245        DEALLOCATE(glat)
246        DEALLOCATE(phisfi)
247        DEALLOCATE(albedodat)
248        DEALLOCATE(zmea)
249        DEALLOCATE(zstd)
250        DEALLOCATE(zsig)
251        DEALLOCATE(zgam)
252        DEALLOCATE(zthe)
253        !deallocate(l0)
254        deallocate(wstar)
255        deallocate(ustar)
256        deallocate(tstar)
257        deallocate(hfmax_th)
258        deallocate(zmax_th)
259
260END SUBROUTINE phys_state_var_end
261
262      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.