source: trunk/LMDZ.GENERIC/libf/phystd/phys_state_var_mod.F90 @ 3436

Last change on this file since 3436 was 3397, checked in by bhatnags, 4 months ago

GENERIC-PCM: Fix/clarification of the usage of tice (sea ice surface temperature) vs. tsea_ice (temperature of the top layer (ice or snow)).

SB

File size: 13.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 slab_ice_h, only : noceanmx
16      USE ocean_slab_mod, ONLY: nslay
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      use nonoro_gwd_ran_mod, only: ini_nonoro_gwd_ran, end_nonoro_gwd_ran
22
23      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
24! Useful for Dynamical Heating calculation.
25      real,allocatable,dimension(:,:),save :: zuprevious
26!$OMP THREADPRIVATE(ztprevious,zuprevious)
27
28      real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
29      real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
30      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
31      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
32      real, dimension(:),allocatable,save :: albedo_equivalent1     ! Spectral Mean albedo clear sky.
33      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
34      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
35!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_equivalent1,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
36
37      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
38      real,dimension(:),allocatable,save :: rnat              ! Defines the type of the grid (ocean,continent,...). By BC.
39!$OMP THREADPRIVATE(albedo_bareground,rnat)
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_lw1     ! Incident Long Wave (IR) surface flux (W.m-2) clear sky.
54      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
55      real,dimension(:),allocatable,save :: fluxsurf_sw1     ! Incident Short Wave (stellar) surface flux (W.m-2) clear sky.
56      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
57!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_lw1,fluxsurf_sw,fluxsurf_sw1,fluxsurfabs_sw)
58
59      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
60      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
61      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
62      real,dimension(:),allocatable,save :: fluxabs_sw1      ! Absorbed SW (stellar) flux (W.m-2) clear sky.
63      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
64      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
65!$OMP THREADPRIVATE(fluxtop_lw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
66
67      real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
68      real,dimension(:,:),allocatable,save :: OSR_nu        ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)).
69      real,dimension(:,:),allocatable,save :: GSR_nu        ! Surface SW (or 'Ground' SW) radiation in each band (Normalized to the band width (W/m2/cm-1)).
70      real,dimension(:,:),allocatable,save :: zdtlw         ! LW heating tendencies (K/s).
71      real,dimension(:,:),allocatable,save :: zdtsw         ! SW heating tendencies (K/s).
72      !real,dimension(:),allocatable,save :: sensibFlux      ! Turbulent flux given by the atmosphere to the surface (W.m-2).
73!$OMP THREADPRIVATE(OLR_nu,OSR_nu,GSR_nu,zdtlw,zdtsw)
74
75      real,dimension(:,:,:),allocatable,save :: int_dtauv   ! VI optical thickness of layers within narrowbands for diags ().
76      real,dimension(:,:,:),allocatable,save :: int_dtaui   ! IR optical thickness of layers within narrowbands for diags ().
77!$OMP THREADPRIVATE(int_dtaui,int_dtauv)
78
79      real,allocatable,dimension(:),save :: tau_col ! Total Aerosol Optical Depth.
80      real,allocatable,save :: hice(:) ! Oceanic Ice height. by BC
81!$OMP THREADPRIVATE(tau_col,hice)
82
83      real,allocatable,dimension(:,:),save :: cloudfrac  ! Fraction of clouds (%).
84      real,allocatable,dimension(:),save :: totcloudfrac ! Column fraction of clouds (%).
85!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
86
87      real,allocatable,dimension(:,:),save :: qsurf_hist
88      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
89!$OMP THREADPRIVATE(qsurf_hist,nueffrad)
90
91      real,dimension(:),allocatable,save ::  pctsrf_sic
92      real,dimension(:,:),allocatable,save :: tslab        ! Slab_ocean temperature (K)
93      real,dimension(:),allocatable,save ::  tsea_ice      ! Temperature of the top layer (K), either snow or ice
94!      real,dimension(:),allocatable,save :: tice           ! Sea ice temperature (K)
95      real,dimension(:),allocatable,save :: sea_ice
96      real,dimension(:),allocatable,save :: zmasq
97      integer,dimension(:),allocatable,save ::knindex
98      real,allocatable,dimension(:,:,:),save :: reffrad
99      real,dimension(:), allocatable,save :: fluxgrdocean  ! Surface conduction flux (W.m-2) with slab_ocean.
100!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad,fluxgrdocean)
101
102      real,dimension(:,:),allocatable,save :: dEzdiff   ! Turbulent diffusion heating (W.m-2)
103      real,dimension(:),allocatable,save :: dEdiff      ! Integrated turbulent diffusion heating (W.m-2)
104      real,dimension(:),allocatable,save :: dEdiffs
105      real,dimension(:,:),allocatable,save :: dEzRadsw  ! Radiative heating (W.m-2)
106      real,dimension(:,:),allocatable,save :: dEzRadlw  ! Radiative heating (W.m-2)
107!$OMP THREADPRIVATE(dEzdiff,dEdiff,dEdiffs,dEzRadsw,dEzRadlw)
108
109      real,dimension(:),allocatable,save :: madjdE      ! Heat from moistadj (W.m-2)
110      real,dimension(:,:),allocatable,save :: madjdEz   ! Heat from moistadj (W.m-2)
111      real,dimension(:),allocatable,save :: lscaledE    ! Heat from largescale (W.m-2)
112      real,dimension(:,:),allocatable,save :: lscaledEz ! Heat from largescale (W.m-2)
113!$OMP THREADPRIVATE(madjdE,madjdEz,lscaledE,lscaledEz)
114     
115      real,dimension(:),allocatable,save :: genericconddE ! Heat from generic condensation (W.m-2)
116!$OMP THREADPRIVATE(genericconddE)
117
118      real,dimension(:),allocatable,save :: H2Omaxcol ! Maximum possible H2O column amount (at 100% saturation) (kg.m-2).
119!$OMP THREADPRIVATE(H2Omaxcol)
120     
121CONTAINS
122
123!======================================================================
124SUBROUTINE phys_state_var_init(nqtot)
125
126IMPLICIT NONE
127
128        integer,intent(in) :: nqtot
129
130!  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
131!
132!zmea(:)   ! orographie moyenne
133!zstd(:)   ! deviation standard de l'OESM
134!zsig(:)   ! pente de l'OESM
135!zgam(:)   ! anisotropie de l'OESM
136!zthe(:)   ! orientation de l'OESM
137!zpic(:)   ! Maximum de l'OESM
138!zval(:)   ! Minimum de l'OESM
139!rugoro(:) ! longueur de rugosite de l'OESM
140
141        ALLOCATE(phisfi(klon))
142        ALLOCATE(tsurf(klon))
143        ALLOCATE(tsoil(klon,nsoilmx))
144        ALLOCATE(albedo(klon,L_NSPECTV))
145        ALLOCATE(albedo_equivalent(klon))
146        ALLOCATE(albedo_equivalent1(klon))
147        ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
148        ALLOCATE(albedo_co2_ice_SPECTV(L_NSPECTV))
149        ALLOCATE(albedo_bareground(klon))
150        ALLOCATE(rnat(klon))
151        ALLOCATE(emis(klon))
152        ALLOCATE(dtrad(klon,klev))
153        ALLOCATE(fluxrad_sky(klon))
154        ALLOCATE(fluxrad(klon))
155        ALLOCATE(capcal(klon))
156        ALLOCATE(fluxgrd(klon))
157        ALLOCATE(fluxgrdocean(klon))
158        ALLOCATE(qsurf(klon,nqtot))
159        ALLOCATE(q2(klon,klev+1))
160        ALLOCATE(ztprevious(klon,klev))
161        ALLOCATE(zuprevious(klon,klev))
162        ALLOCATE(cloudfrac(klon,klev))
163        ALLOCATE(totcloudfrac(klon))
164        ALLOCATE(hice(klon))
165        ALLOCATE(qsurf_hist(klon,nqtot))
166        ALLOCATE(reffrad(klon,klev,naerkind))
167        ALLOCATE(nueffrad(klon,klev,naerkind))
168        ALLOCATE(fluxsurf_lw(klon))
169        ALLOCATE(fluxsurf_lw1(klon))
170        ALLOCATE(fluxsurf_sw(klon))
171        ALLOCATE(fluxsurf_sw1(klon))
172        ALLOCATE(fluxsurfabs_sw(klon))
173        ALLOCATE(fluxtop_lw(klon))
174        ALLOCATE(fluxtop_lw1(klon))
175        ALLOCATE(fluxabs_sw(klon))
176        ALLOCATE(fluxabs_sw1(klon))
177        ALLOCATE(fluxtop_dn(klon))
178        ALLOCATE(fluxdyn(klon))
179        ALLOCATE(OLR_nu(klon,L_NSPECTI))
180        ALLOCATE(OSR_nu(klon,L_NSPECTV))
181        ALLOCATE(GSR_nu(klon,L_NSPECTV))
182        ALLOCATE(int_dtaui(klon,klev,L_NSPECTI))
183        ALLOCATE(int_dtauv(klon,klev,L_NSPECTV))
184        ALLOCATE(sensibFlux(klon))
185        ALLOCATE(zdtlw(klon,klev))
186        ALLOCATE(zdtsw(klon,klev))
187        ALLOCATE(tau_col(klon))
188        ALLOCATE(pctsrf_sic(klon))
189        ALLOCATE(tslab(klon,nslay))
190        ALLOCATE(tsea_ice(klon))
191!        ALLOCATE(tice(klon))
192        ALLOCATE(sea_ice(klon))
193        ALLOCATE(zmasq(klon))
194        ALLOCATE(knindex(klon))
195        ALLOCATE(dEzdiff(klon,klev))
196        ALLOCATE(dEdiff(klon))
197        ALLOCATE(dEdiffs(klon))
198        ALLOCATE(dEzRadsw(klon,klev))
199        ALLOCATE(dEzRadlw(klon,klev))
200        ALLOCATE(madjdE(klon))
201        ALLOCATE(madjdEz(klon,klev))
202        ALLOCATE(lscaledE(klon))
203        ALLOCATE(lscaledEz(klon,klev))
204        ALLOCATE(genericconddE(klon))
205        ALLOCATE(H2Omaxcol(klon))
206        ! This is defined in comsaison_h
207        ALLOCATE(mu0(klon))
208        ALLOCATE(fract(klon))
209         ! This is defined in radcommon_h
210        ALLOCATE(glat(klon))
211        ALLOCATE(albedodat(klon))
212        ALLOCATE(zmea(klon))
213        ALLOCATE(zstd(klon))
214        ALLOCATE(zsig(klon))
215        ALLOCATE(zgam(klon))
216        ALLOCATE(zthe(klon))
217        !allocate(l0(klon))
218        allocate(wstar(klon))
219        allocate(ustar(klon))
220        allocate(tstar(klon))
221        allocate(hfmax_th(klon))
222        allocate(zmax_th(klon))
223        ! allocate arrays in "nonoro_gwd_ran_mod"
224        call ini_nonoro_gwd_ran(klon,klev)
225END SUBROUTINE phys_state_var_init
226
227!======================================================================
228SUBROUTINE phys_state_var_end
229
230IMPLICIT NONE
231
232        DEALLOCATE(tsurf)
233        DEALLOCATE(tsoil)
234        DEALLOCATE(albedo)
235        DEALLOCATE(albedo_equivalent)
236        DEALLOCATE(albedo_equivalent1)
237        DEALLOCATE(albedo_snow_SPECTV)
238        DEALLOCATE(albedo_co2_ice_SPECTV)
239        DEALLOCATE(albedo_bareground)
240        DEALLOCATE(rnat)
241        DEALLOCATE(emis)
242        DEALLOCATE(dtrad)
243        DEALLOCATE(fluxrad_sky)
244        DEALLOCATE(fluxrad)
245        DEALLOCATE(capcal)
246
247        DEALLOCATE(fluxgrd)
248        DEALLOCATE(fluxgrdocean)
249        DEALLOCATE(qsurf)
250        DEALLOCATE(q2)
251        DEALLOCATE(ztprevious)
252        DEALLOCATE(zuprevious)
253        DEALLOCATE(cloudfrac)
254        DEALLOCATE(totcloudfrac)
255        DEALLOCATE(hice)
256        DEALLOCATE(qsurf_hist)
257        DEALLOCATE(reffrad)
258        DEALLOCATE(nueffrad)
259        DEALLOCATE(fluxsurf_lw)
260        DEALLOCATE(fluxsurf_lw1)
261        DEALLOCATE(fluxsurf_sw)
262        DEALLOCATE(fluxsurf_sw1)
263        DEALLOCATE(fluxsurfabs_sw)
264        DEALLOCATE(fluxtop_lw)
265        DEALLOCATE(fluxtop_lw1)
266        DEALLOCATE(fluxabs_sw)
267        DEALLOCATE(fluxabs_sw1)
268        DEALLOCATE(fluxtop_dn)
269        DEALLOCATE(fluxdyn)
270        DEALLOCATE(OLR_nu)
271        DEALLOCATE(OSR_nu)
272        DEALLOCATE(GSR_nu)
273        DEALLOCATE(int_dtaui)
274        DEALLOCATE(int_dtauv)
275        DEALLOCATE(sensibFlux)
276        DEALLOCATE(zdtlw)
277        DEALLOCATE(zdtsw)
278        DEALLOCATE(tau_col)
279        DEALLOCATE(pctsrf_sic)
280        DEALLOCATE(tslab)
281        DEALLOCATE(tsea_ice)
282 !       DEALLOCATE(tice)
283        DEALLOCATE(sea_ice)
284        DEALLOCATE(zmasq)
285        DEALLOCATE(knindex)
286        DEALLOCATE(dEzdiff)
287        DEALLOCATE(dEdiff)
288        DEALLOCATE(dEdiffs)
289        DEALLOCATE(dEzRadsw)
290        DEALLOCATE(dEzRadlw)
291        DEALLOCATE(madjdE)
292        DEALLOCATE(madjdEz)
293        DEALLOCATE(lscaledE)
294        DEALLOCATE(lscaledEz)
295        DEALLOCATE(genericconddE)
296        DEALLOCATE(H2Omaxcol)       
297        DEALLOCATE(mu0)
298        DEALLOCATE(fract)
299        DEALLOCATE(glat)
300        DEALLOCATE(phisfi)
301        DEALLOCATE(albedodat)
302        DEALLOCATE(zmea)
303        DEALLOCATE(zstd)
304        DEALLOCATE(zsig)
305        DEALLOCATE(zgam)
306        DEALLOCATE(zthe)
307        !deallocate(l0)
308        deallocate(wstar)
309        deallocate(ustar)
310        deallocate(tstar)
311        deallocate(hfmax_th)
312        deallocate(zmax_th)
313        ! deallocate arrays in "nonoro_gwd_ran_mod"
314        call end_nonoro_gwd_ran
315
316END SUBROUTINE phys_state_var_end
317
318      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.