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

Last change on this file since 1980 was 1883, checked in by emillour, 7 years ago

Generic GCM:

  • fix rcm1d.F to cope with modifications introduced in revision 1835-1836
  • also add some missing threadprivate OpenMP directives in phys_state_var_mod and turb_mod

EM

File size: 10.0 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 turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th
20
21      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
22! Useful for Dynamical Heating calculation.
23      real,allocatable,dimension(:,:),save :: zuprevious
24!$OMP THREADPRIVATE(ztprevious,zuprevious)
25
26      real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
27      real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
28      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
29      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
30      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
31      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
32!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
33
34      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
35      real,dimension(:),allocatable,save :: rnat              ! Defines the type of the grid (ocean,continent,...). By BC.
36!$OMP THREADPRIVATE(albedo_bareground,rnat)
37
38      real,dimension(:),allocatable,save :: emis        ! Thermal IR surface emissivity.
39      real,dimension(:,:),allocatable,save :: dtrad     ! Net atmospheric radiative heating rate (K.s-1).
40      real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2).
41      real,dimension(:),allocatable,save :: fluxrad     ! Net radiative surface flux (W.m-2).
42      real,dimension(:),allocatable,save :: capcal      ! Surface heat capacity (J m-2 K-1).
43      real,dimension(:),allocatable,save :: fluxgrd     ! Surface conduction flux (W.m-2).
44      real,dimension(:,:),allocatable,save :: qsurf     ! Tracer on surface (e.g. kg.m-2).
45!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf)
46
47      ! FOR DIAGNOSTIC :
48
49      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
50      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
51      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
52!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw)
53
54      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
55      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
56      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
57      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
58!$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn)
59
60      real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
61      real,dimension(:,:),allocatable,save :: OSR_nu        ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)).
62      real,dimension(:,:),allocatable,save :: zdtlw         ! LW heating tendencies (K/s).
63      real,dimension(:,:),allocatable,save :: zdtsw         ! SW heating tendencies (K/s).
64      !real,dimension(:),allocatable,save :: sensibFlux      ! Turbulent flux given by the atmosphere to the surface (W.m-2).
65!$OMP THREADPRIVATE(OLR_nu,OSR_nu,zdtlw,zdtsw)
66
67      real,allocatable,dimension(:),save :: tau_col ! Total Aerosol Optical Depth.
68      real,allocatable,save :: hice(:) ! Oceanic Ice height. by BC
69!$OMP THREADPRIVATE(tau_col,hice)
70
71      real,allocatable,dimension(:,:),save :: cloudfrac  ! Fraction of clouds (%).
72      real,allocatable,dimension(:),save :: totcloudfrac ! Column fraction of clouds (%).
73!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
74
75      real,allocatable,dimension(:,:),save :: qsurf_hist
76      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
77!$OMP THREADPRIVATE(qsurf_hist,nueffrad)
78
79      real,allocatable,dimension(:),save :: ice_initial
80      real,allocatable,dimension(:),save :: ice_min
81!$OMP THREADPRIVATE(ice_initial,ice_min)
82
83      real, dimension(:),allocatable,save ::  pctsrf_sic
84      real, dimension(:,:),allocatable,save :: tslab
85      real, dimension(:),allocatable,save ::  tsea_ice
86      real, dimension(:),allocatable,save :: sea_ice
87      real, dimension(:),allocatable,save :: zmasq
88      integer, dimension(:),allocatable,save ::knindex
89      real,allocatable,dimension(:,:,:),save :: reffrad
90!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad)
91     
92CONTAINS
93
94!======================================================================
95SUBROUTINE phys_state_var_init(nqtot)
96
97IMPLICIT NONE
98
99        integer,intent(in) :: nqtot
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.