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

Last change on this file since 3380 was 3195, checked in by afalco, 10 months ago

Pluto PCM:
Imported condense n2 from pluto.old.
Aerosol data from Pluto.old not yet working.
AF

File size: 11.8 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 :: cloudfrac  ! Fraction of clouds (%).
79      real,allocatable,dimension(:),save :: totcloudfrac ! Column fraction of clouds (%).
80!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
81
82
83      real,allocatable,dimension(:,:),save :: qsurf_hist
84      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
85      real,allocatable,dimension(:,:,:),save :: reffrad
86!$OMP THREADPRIVATE(qsurf_hist,nueffrad,reffrad)
87
88      real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
89      real,dimension(:),allocatable,save :: dEdiff      ! Integrated turbulent diffusion heating (W.m-2)
90      real,dimension(:),allocatable,save :: dEdiffs
91      real,dimension(:,:),allocatable,save :: dEzRadsw  ! Radiative heating (W.m-2)
92      real,dimension(:,:),allocatable,save :: dEzRadlw  ! Radiative heating (W.m-2)
93!$OMP THREADPRIVATE(dEzdiff,dEdiff,dEdiffs,dEzRadsw,dEzRadlw)
94
95      real,dimension(:),allocatable,save :: madjdE      ! Heat from moistadj (W.m-2)
96      real,dimension(:,:),allocatable,save :: madjdEz   ! Heat from moistadj (W.m-2)
97      real,dimension(:),allocatable,save :: lscaledE    ! Heat from largescale (W.m-2)
98      real,dimension(:,:),allocatable,save :: lscaledEz ! Heat from largescale (W.m-2)
99!$OMP THREADPRIVATE(madjdE,madjdEz,lscaledE,lscaledEz)
100
101      real,dimension(:),allocatable,save :: genericconddE ! Heat from generic condensation (W.m-2)
102!$OMP THREADPRIVATE(genericconddE)
103
104CONTAINS
105
106!======================================================================
107SUBROUTINE phys_state_var_init(nqtot)
108
109IMPLICIT NONE
110
111        integer,intent(in) :: nqtot
112
113!  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
114!
115!zmea(:)   ! orographie moyenne
116!zstd(:)   ! deviation standard de l'OESM
117!zsig(:)   ! pente de l'OESM
118!zgam(:)   ! anisotropie de l'OESM
119!zthe(:)   ! orientation de l'OESM
120!zpic(:)   ! Maximum de l'OESM
121!zval(:)   ! Minimum de l'OESM
122!rugoro(:) ! longueur de rugosite de l'OESM
123
124        ALLOCATE(phisfi(klon))
125        ALLOCATE(tsurf(klon))
126        ALLOCATE(tsoil(klon,nsoilmx))
127        ALLOCATE(albedo(klon,L_NSPECTV))
128        ALLOCATE(albedo_equivalent(klon))
129        ALLOCATE(albedo_equivalent1(klon))
130        ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
131        ALLOCATE(albedo_n2_ice_SPECTV(L_NSPECTV))
132        ALLOCATE(albedo_bareground(klon))
133        ALLOCATE(emis(klon))
134        ALLOCATE(dtrad(klon,klev))
135        ALLOCATE(fluxrad_sky(klon))
136        ALLOCATE(fluxrad(klon))
137        ALLOCATE(capcal(klon))
138        ALLOCATE(fluxgrd(klon))
139        ALLOCATE(qsurf(klon,nqtot))
140        ALLOCATE(q2(klon,klev+1))
141        ALLOCATE(ztprevious(klon,klev))
142        ALLOCATE(zuprevious(klon,klev))
143        ALLOCATE(cloudfrac(klon,klev))
144        ALLOCATE(totcloudfrac(klon))
145        ALLOCATE(qsurf_hist(klon,nqtot))
146        ALLOCATE(reffrad(klon,klev,naerkind))
147        ALLOCATE(nueffrad(klon,klev,naerkind))
148        ALLOCATE(fluxsurf_lw(klon))
149        ALLOCATE(fluxsurf_lw1(klon))
150        ALLOCATE(fluxsurf_sw(klon))
151        ALLOCATE(fluxsurf_sw1(klon))
152        ALLOCATE(fluxsurfabs_sw(klon))
153        ALLOCATE(fluxtop_lw(klon))
154        ALLOCATE(fluxtop_lw1(klon))
155        ALLOCATE(fluxabs_sw(klon))
156        ALLOCATE(fluxabs_sw1(klon))
157        ALLOCATE(fluxtop_dn(klon))
158        ALLOCATE(fluxdyn(klon))
159        ALLOCATE(OLR_nu(klon,L_NSPECTI))
160        ALLOCATE(OSR_nu(klon,L_NSPECTV))
161        ALLOCATE(GSR_nu(klon,L_NSPECTV))
162        ALLOCATE(int_dtaui(klon,klev,L_NSPECTI))
163        ALLOCATE(int_dtauv(klon,klev,L_NSPECTV))
164        ALLOCATE(sensibFlux(klon))
165        ALLOCATE(zdtlw(klon,klev))
166        ALLOCATE(zdtsw(klon,klev))
167        ALLOCATE(tau_col(klon))
168        ALLOCATE(dEzdiff(klon,klev))
169        ALLOCATE(dEdiff(klon))
170        ALLOCATE(dEdiffs(klon))
171        ALLOCATE(dEzRadsw(klon,klev))
172        ALLOCATE(dEzRadlw(klon,klev))
173        ALLOCATE(madjdE(klon))
174        ALLOCATE(madjdEz(klon,klev))
175        ALLOCATE(lscaledE(klon))
176        ALLOCATE(lscaledEz(klon,klev))
177        ALLOCATE(genericconddE(klon))
178        ! This is defined in comsaison_h
179        ALLOCATE(mu0(klon))
180        ALLOCATE(fract(klon))
181         ! This is defined in radcommon_h
182        ALLOCATE(glat(klon))
183        ALLOCATE(albedodat(klon))
184        ALLOCATE(zmea(klon))
185        ALLOCATE(zstd(klon))
186        ALLOCATE(zsig(klon))
187        ALLOCATE(zgam(klon))
188        ALLOCATE(zthe(klon))
189        !allocate(l0(klon))
190        allocate(wstar(klon))
191        allocate(ustar(klon))
192        allocate(tstar(klon))
193        allocate(hfmax_th(klon))
194        allocate(zmax_th(klon))
195END SUBROUTINE phys_state_var_init
196
197!======================================================================
198SUBROUTINE phys_state_var_end
199
200IMPLICIT NONE
201
202        DEALLOCATE(tsurf)
203        DEALLOCATE(tsoil)
204        DEALLOCATE(albedo)
205        DEALLOCATE(albedo_equivalent)
206        DEALLOCATE(albedo_equivalent1)
207        DEALLOCATE(albedo_snow_SPECTV)
208        DEALLOCATE(albedo_n2_ice_SPECTV)
209        DEALLOCATE(albedo_bareground)
210        DEALLOCATE(emis)
211        DEALLOCATE(dtrad)
212        DEALLOCATE(fluxrad_sky)
213        DEALLOCATE(fluxrad)
214        DEALLOCATE(capcal)
215
216        DEALLOCATE(fluxgrd)
217        DEALLOCATE(qsurf)
218        DEALLOCATE(q2)
219        DEALLOCATE(ztprevious)
220        DEALLOCATE(zuprevious)
221        DEALLOCATE(cloudfrac)
222        DEALLOCATE(totcloudfrac)
223        DEALLOCATE(qsurf_hist)
224        DEALLOCATE(reffrad)
225        DEALLOCATE(nueffrad)
226        DEALLOCATE(fluxsurf_lw)
227        DEALLOCATE(fluxsurf_lw1)
228        DEALLOCATE(fluxsurf_sw)
229        DEALLOCATE(fluxsurf_sw1)
230        DEALLOCATE(fluxsurfabs_sw)
231        DEALLOCATE(fluxtop_lw)
232        DEALLOCATE(fluxtop_lw1)
233        DEALLOCATE(fluxabs_sw)
234        DEALLOCATE(fluxabs_sw1)
235        DEALLOCATE(fluxtop_dn)
236        DEALLOCATE(fluxdyn)
237        DEALLOCATE(OLR_nu)
238        DEALLOCATE(OSR_nu)
239        DEALLOCATE(GSR_nu)
240        DEALLOCATE(int_dtaui)
241        DEALLOCATE(int_dtauv)
242        DEALLOCATE(sensibFlux)
243        DEALLOCATE(zdtlw)
244        DEALLOCATE(zdtsw)
245        DEALLOCATE(tau_col)
246        DEALLOCATE(dEzdiff)
247        DEALLOCATE(dEdiff)
248        DEALLOCATE(dEdiffs)
249        DEALLOCATE(dEzRadsw)
250        DEALLOCATE(dEzRadlw)
251        DEALLOCATE(madjdE)
252        DEALLOCATE(madjdEz)
253        DEALLOCATE(lscaledE)
254        DEALLOCATE(lscaledEz)
255        DEALLOCATE(genericconddE)
256        DEALLOCATE(mu0)
257        DEALLOCATE(fract)
258        DEALLOCATE(glat)
259        DEALLOCATE(phisfi)
260        DEALLOCATE(albedodat)
261        DEALLOCATE(zmea)
262        DEALLOCATE(zstd)
263        DEALLOCATE(zsig)
264        DEALLOCATE(zgam)
265        DEALLOCATE(zthe)
266        !deallocate(l0)
267        deallocate(wstar)
268        deallocate(ustar)
269        deallocate(tstar)
270        deallocate(hfmax_th)
271        deallocate(zmax_th)
272
273END SUBROUTINE phys_state_var_end
274
275      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.