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

Last change on this file since 1838 was 1835, checked in by mlefevre, 8 years ago

MESOSCALE GENERIC. added phys_state_var_mod.F90 which takes care of the allocation of relevant arrays for physiq_mod. this is important for mesoscale purposes. in this commit phys_state_var_mod is not called in the physics so presumably nothing is broken.

File size: 9.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 radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind
17      use surfdat_h, only: phisfi, albedodat,  &
18                        zmea, zstd, zsig, zgam, zthe
19      use tracer_h, only: nqtot
20      use turb_mod
21!#include "bands.h"
22!#include "scatterers.h"
23!      INTEGER, SAVE :: radpas
24!!$OMP THREADPRIVATE(radpas)
25!      REAL, SAVE :: dtime
26!!$OMP THREADPRIVATE(dtime)
27      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
28! Useful for Dynamical Heating calculation.
29      real,allocatable,dimension(:,:),save :: zuprevious
30      real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
31      real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
32      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
33      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
34      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
35      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
36
37!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
38
39      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
40      real,dimension(:),allocatable,save :: rnat              ! Defines the type of the grid (ocean,continent,...). By BC.
41
42!$OMP THREADPRIVATE(albedo_bareground,rnat)
43
44      real,dimension(:),allocatable,save :: emis        ! Thermal IR surface emissivity.
45      real,dimension(:,:),allocatable,save :: dtrad     ! Net atmospheric radiative heating rate (K.s-1).
46      real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2).
47      real,dimension(:),allocatable,save :: fluxrad     ! Net radiative surface flux (W.m-2).
48      real,dimension(:),allocatable,save :: capcal      ! Surface heat capacity (J m-2 K-1).
49      real,dimension(:),allocatable,save :: fluxgrd     ! Surface conduction flux (W.m-2).
50      real,dimension(:,:),allocatable,save :: qsurf     ! Tracer on surface (e.g. kg.m-2).
51      !real,dimension(:,:),allocatable,save :: q2        ! Turbulent Kinetic Energy.
52
53
54      ! FOR DIAGNOSTIC :
55
56      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
57      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
58      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
59      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
60      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
61      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
62      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
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
69      real,allocatable,dimension(:),save :: tau_col ! Total Aerosol Optical Depth.
70      real,allocatable,save :: hice(:) ! Oceanic Ice height. by BC
71!$OMP THREADPRIVATE(tau_col,hice)
72
73      real,allocatable,dimension(:,:),save :: cloudfrac  ! Fraction of clouds (%).
74      real,allocatable,dimension(:),save :: totcloudfrac ! Column fraction of clouds (%).
75!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
76
77      real,allocatable,dimension(:,:),save :: qsurf_hist
78!$OMP THREADPRIVATE(qsurf_hist)
79      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
80
81      real,allocatable,dimension(:),save :: ice_initial
82      real,allocatable,dimension(:),save :: ice_min
83
84
85      real, dimension(:),allocatable,save ::  pctsrf_sic
86      real, dimension(:,:),allocatable,save :: tslab
87      real, dimension(:),allocatable,save ::  tsea_ice
88      real, dimension(:),allocatable,save :: sea_ice
89      real, dimension(:),allocatable,save :: zmasq
90      integer, dimension(:),allocatable,save ::knindex
91      real,allocatable,dimension(:,:,:),save :: reffrad
92
93!$OMP THREADPRIVATE(dlw,fder)
94CONTAINS
95
96!======================================================================
97SUBROUTINE phys_state_var_init
98
99IMPLICIT NONE
100
101!  Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
102!
103!zmea(:)   ! orographie moyenne
104!zstd(:)   ! deviation standard de l'OESM
105!zsig(:)   ! pente de l'OESM
106!zgam(:)   ! anisotropie de l'OESM
107!zthe(:)   ! orientation de l'OESM
108!zpic(:)   ! Maximum de l'OESM
109!zval(:)   ! Minimum de l'OESM
110!rugoro(:) ! longueur de rugosite de l'OESM
111        print*,'klon',klon,'klev',klev
112        ALLOCATE(phisfi(klon))
113        ALLOCATE(tsurf(klon))
114        ALLOCATE(tsoil(klon,nsoilmx))
115        ALLOCATE(albedo(klon,L_NSPECTV))
116        ALLOCATE(albedo_equivalent(klon))
117        ALLOCATE(albedo_snow_SPECTV(L_NSPECTV))
118        ALLOCATE(albedo_co2_ice_SPECTV(L_NSPECTV))
119        ALLOCATE(albedo_bareground(klon))
120        ALLOCATE(rnat(klon))
121        ALLOCATE(emis(klon))
122        ALLOCATE(dtrad(klon,klev))
123        ALLOCATE(fluxrad_sky(klon))
124        ALLOCATE(fluxrad(klon))
125        ALLOCATE(capcal(klon))
126        ALLOCATE(fluxgrd(klon))
127        ALLOCATE(qsurf(klon,nqtot))
128        ALLOCATE(q2(klon,klev+1))
129        ALLOCATE(ztprevious(klon,klev))
130        ALLOCATE(zuprevious(klon,klev))
131        ALLOCATE(cloudfrac(klon,klev))
132        ALLOCATE(totcloudfrac(klon))
133        ALLOCATE(hice(klon))
134        ALLOCATE(qsurf_hist(klon,nqtot))
135        ALLOCATE(reffrad(klon,klev,naerkind))
136        ALLOCATE(nueffrad(klon,klev,naerkind))
137        ALLOCATE(ice_initial(klon))
138        ALLOCATE(ice_min(klon))
139        ALLOCATE(fluxsurf_lw(klon))
140        ALLOCATE(fluxsurf_sw(klon))
141        ALLOCATE(fluxsurfabs_sw(klon))
142        ALLOCATE(fluxtop_lw(klon))
143        ALLOCATE(fluxabs_sw(klon))
144        ALLOCATE(fluxtop_dn(klon))
145        ALLOCATE(fluxdyn(klon))
146        ALLOCATE(OLR_nu(klon,L_NSPECTI))
147        ALLOCATE(OSR_nu(klon,L_NSPECTV))
148        ALLOCATE(sensibFlux(klon))
149        ALLOCATE(zdtlw(klon,klev))
150        ALLOCATE(zdtsw(klon,klev))
151        ALLOCATE(tau_col(klon))
152        ALLOCATE(pctsrf_sic(klon))
153        ALLOCATE(tslab(klon,noceanmx))
154        ALLOCATE(tsea_ice(klon))
155        ALLOCATE(sea_ice(klon))
156        ALLOCATE(zmasq(klon))
157        ALLOCATE(knindex(klon))
158        ! This is defined in comsaison_h
159        ALLOCATE(mu0(klon))
160        ALLOCATE(fract(klon))
161         ! This is defined in radcommon_h
162        ALLOCATE(glat(klon))
163        ALLOCATE(albedodat(klon))
164        ALLOCATE(zmea(klon))
165        ALLOCATE(zstd(klon))
166        ALLOCATE(zsig(klon))
167        ALLOCATE(zgam(klon))
168        ALLOCATE(zthe(klon))
169        !allocate(l0(klon))
170        allocate(wstar(klon))
171        allocate(ustar(klon))
172        allocate(tstar(klon))
173        allocate(hfmax_th(klon))
174        allocate(zmax_th(klon))
175
176END SUBROUTINE phys_state_var_init
177
178!======================================================================
179SUBROUTINE phys_state_var_end
180
181IMPLICIT NONE
182
183        DEALLOCATE(tsurf)
184        DEALLOCATE(tsoil)
185        DEALLOCATE(albedo)
186        DEALLOCATE(albedo_equivalent)
187        DEALLOCATE(albedo_snow_SPECTV)
188        DEALLOCATE(albedo_co2_ice_SPECTV)
189        DEALLOCATE(albedo_bareground)
190        DEALLOCATE(rnat)
191        DEALLOCATE(emis)
192        DEALLOCATE(dtrad)
193        DEALLOCATE(fluxrad_sky)
194        DEALLOCATE(fluxrad)
195        DEALLOCATE(capcal)
196
197        DEALLOCATE(fluxgrd)
198        DEALLOCATE(qsurf)
199        DEALLOCATE(q2)
200        DEALLOCATE(ztprevious)
201        DEALLOCATE(zuprevious)
202        DEALLOCATE(cloudfrac)
203        DEALLOCATE(totcloudfrac)
204        DEALLOCATE(hice)
205        DEALLOCATE(qsurf_hist)
206        DEALLOCATE(reffrad)
207        DEALLOCATE(nueffrad)
208        DEALLOCATE(ice_initial)
209        DEALLOCATE(ice_min)
210        DEALLOCATE(fluxsurf_lw)
211        DEALLOCATE(fluxsurf_sw)
212        DEALLOCATE(fluxsurfabs_sw)
213        DEALLOCATE(fluxtop_lw)
214        DEALLOCATE(fluxabs_sw)
215        DEALLOCATE(fluxtop_dn)
216        DEALLOCATE(fluxdyn)
217        DEALLOCATE(OLR_nu)
218        DEALLOCATE(OSR_nu)
219        DEALLOCATE(sensibFlux)
220        DEALLOCATE(zdtlw)
221        DEALLOCATE(zdtsw)
222        DEALLOCATE(tau_col)
223        DEALLOCATE(pctsrf_sic)
224        DEALLOCATE(tslab)
225        DEALLOCATE(tsea_ice)
226        DEALLOCATE(sea_ice)
227        DEALLOCATE(zmasq)
228        DEALLOCATE(knindex)
229        DEALLOCATE(mu0)
230        DEALLOCATE(fract)
231        DEALLOCATE(glat)
232        DEALLOCATE(phisfi)
233        DEALLOCATE(albedodat)
234        DEALLOCATE(zmea)
235        DEALLOCATE(zstd)
236        DEALLOCATE(zsig)
237        DEALLOCATE(zgam)
238        DEALLOCATE(zthe)
239        !deallocate(l0)
240        deallocate(wstar)
241        deallocate(ustar)
242        deallocate(tstar)
243        deallocate(hfmax_th)
244        deallocate(zmax_th)
245
246
247END SUBROUTINE phys_state_var_end
248
249      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.