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

Last change on this file since 2447 was 2299, checked in by dbardet, 5 years ago

27/04/2017 (r2299) == DB

Add non-orographic gravity waves drag parameterization (Flott scheme adpated from the Earth GCM)

It can be called using 'calllott_nonoro=.true.' in callphys.def, and set the maximum value of the Eliassen-Plam flux 'epflux_max'.
Cumulated output fields are du_nonoro, dv_nonoro (winds tendency due to GW drag), east_gwstress and west_gwstress (stress profile in esatward and westward direction due to GW drag)
These variables are added in Xhisitns and start files.

File size: 10.6 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      use nonoro_gwd_ran_mod, only: ini_nonoro_gwd_ran, end_nonoro_gwd_ran
21
22      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
23! Useful for Dynamical Heating calculation.
24      real,allocatable,dimension(:,:),save :: zuprevious
25!$OMP THREADPRIVATE(ztprevious,zuprevious)
26
27      real, dimension(:),allocatable,save ::  tsurf                ! Surface temperature (K).
28      real, dimension(:,:),allocatable,save ::  tsoil              ! Sub-surface temperatures (K).
29      real, dimension(:,:),allocatable,save :: albedo              ! Surface Spectral albedo. By MT2015.
30      real, dimension(:),allocatable,save :: albedo_equivalent     ! Spectral Mean albedo.
31      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
32      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
33!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
34
35      real,dimension(:),allocatable,save :: albedo_bareground ! Bare Ground Albedo. By MT 2015.
36      real,dimension(:),allocatable,save :: rnat              ! Defines the type of the grid (ocean,continent,...). By BC.
37!$OMP THREADPRIVATE(albedo_bareground,rnat)
38
39      real,dimension(:),allocatable,save :: emis        ! Thermal IR surface emissivity.
40      real,dimension(:,:),allocatable,save :: dtrad     ! Net atmospheric radiative heating rate (K.s-1).
41      real,dimension(:),allocatable,save :: fluxrad_sky ! Radiative flux from sky absorbed by surface (W.m-2).
42      real,dimension(:),allocatable,save :: fluxrad     ! Net radiative surface flux (W.m-2).
43      real,dimension(:),allocatable,save :: capcal      ! Surface heat capacity (J m-2 K-1).
44      real,dimension(:),allocatable,save :: fluxgrd     ! Surface conduction flux (W.m-2).
45      real,dimension(:,:),allocatable,save :: qsurf     ! Tracer on surface (e.g. kg.m-2).
46!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf)
47
48      ! FOR DIAGNOSTIC :
49
50      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
51      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
52      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
53!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_sw,fluxsurfabs_sw)
54
55      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
56      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
57      real,dimension(:),allocatable,save :: fluxtop_dn      ! Incoming SW (stellar) radiation at the top of the atmosphere (W.m-2).
58      real,dimension(:),allocatable,save :: fluxdyn         ! Horizontal heat transport by dynamics (W.m-2).
59!$OMP THREADPRIVATE(fluxtop_lw,fluxabs_sw,fluxtop_dn,fluxdyn)
60
61      real,dimension(:,:),allocatable,save :: OLR_nu        ! Outgoing LW radiation in each band (Normalized to the band width (W/m2/cm-1)).
62      real,dimension(:,:),allocatable,save :: OSR_nu        ! Outgoing SW radiation in each band (Normalized to the band width (W/m2/cm-1)).
63      real,dimension(:,:),allocatable,save :: zdtlw         ! LW heating tendencies (K/s).
64      real,dimension(:,:),allocatable,save :: zdtsw         ! SW heating tendencies (K/s).
65      !real,dimension(:),allocatable,save :: sensibFlux      ! Turbulent flux given by the atmosphere to the surface (W.m-2).
66!$OMP THREADPRIVATE(OLR_nu,OSR_nu,zdtlw,zdtsw)
67
68      real,dimension(:,:,:),allocatable,save :: int_dtauv   ! VI optical thickness of layers within narrowbands for diags ().
69      real,dimension(:,:,:),allocatable,save :: int_dtaui   ! IR optical thickness of layers within narrowbands for diags ().
70!$OMP THREADPRIVATE(int_dtaui,int_dtauv)
71
72      real,allocatable,dimension(:),save :: tau_col ! Total Aerosol Optical Depth.
73      real,allocatable,save :: hice(:) ! Oceanic Ice height. by BC
74!$OMP THREADPRIVATE(tau_col,hice)
75
76      real,allocatable,dimension(:,:),save :: cloudfrac  ! Fraction of clouds (%).
77      real,allocatable,dimension(:),save :: totcloudfrac ! Column fraction of clouds (%).
78!$OMP THREADPRIVATE(cloudfrac,totcloudfrac)
79
80      real,allocatable,dimension(:,:),save :: qsurf_hist
81      real,allocatable,dimension(:,:,:),save :: nueffrad ! Aerosol effective radius variance. By RW
82!$OMP THREADPRIVATE(qsurf_hist,nueffrad)
83
84      real,allocatable,dimension(:),save :: ice_initial
85      real,allocatable,dimension(:),save :: ice_min
86!$OMP THREADPRIVATE(ice_initial,ice_min)
87
88      real, dimension(:),allocatable,save ::  pctsrf_sic
89      real, dimension(:,:),allocatable,save :: tslab
90      real, dimension(:),allocatable,save ::  tsea_ice
91      real, dimension(:),allocatable,save :: sea_ice
92      real, dimension(:),allocatable,save :: zmasq
93      integer, dimension(:),allocatable,save ::knindex
94      real,allocatable,dimension(:,:,:),save :: reffrad
95!$OMP THREADPRIVATE(pctsrf_sic,tslab,tsea_ice,sea_ice,zmasq,knindex,reffrad)
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        print*,'klon',klon,'klev',klev
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_snow_SPECTV(L_NSPECTV))
123        ALLOCATE(albedo_co2_ice_SPECTV(L_NSPECTV))
124        ALLOCATE(albedo_bareground(klon))
125        ALLOCATE(rnat(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(cloudfrac(klon,klev))
137        ALLOCATE(totcloudfrac(klon))
138        ALLOCATE(hice(klon))
139        ALLOCATE(qsurf_hist(klon,nqtot))
140        ALLOCATE(reffrad(klon,klev,naerkind))
141        ALLOCATE(nueffrad(klon,klev,naerkind))
142        ALLOCATE(ice_initial(klon))
143        ALLOCATE(ice_min(klon))
144        ALLOCATE(fluxsurf_lw(klon))
145        ALLOCATE(fluxsurf_sw(klon))
146        ALLOCATE(fluxsurfabs_sw(klon))
147        ALLOCATE(fluxtop_lw(klon))
148        ALLOCATE(fluxabs_sw(klon))
149        ALLOCATE(fluxtop_dn(klon))
150        ALLOCATE(fluxdyn(klon))
151        ALLOCATE(OLR_nu(klon,L_NSPECTI))
152        ALLOCATE(OSR_nu(klon,L_NSPECTV))
153        ALLOCATE(int_dtaui(klon,klev,L_NSPECTI))
154        ALLOCATE(int_dtauv(klon,klev,L_NSPECTV))
155        ALLOCATE(sensibFlux(klon))
156        ALLOCATE(zdtlw(klon,klev))
157        ALLOCATE(zdtsw(klon,klev))
158        ALLOCATE(tau_col(klon))
159        ALLOCATE(pctsrf_sic(klon))
160        ALLOCATE(tslab(klon,noceanmx))
161        ALLOCATE(tsea_ice(klon))
162        ALLOCATE(sea_ice(klon))
163        ALLOCATE(zmasq(klon))
164        ALLOCATE(knindex(klon))
165        ! This is defined in comsaison_h
166        ALLOCATE(mu0(klon))
167        ALLOCATE(fract(klon))
168         ! This is defined in radcommon_h
169        ALLOCATE(glat(klon))
170        ALLOCATE(albedodat(klon))
171        ALLOCATE(zmea(klon))
172        ALLOCATE(zstd(klon))
173        ALLOCATE(zsig(klon))
174        ALLOCATE(zgam(klon))
175        ALLOCATE(zthe(klon))
176        !allocate(l0(klon))
177        allocate(wstar(klon))
178        allocate(ustar(klon))
179        allocate(tstar(klon))
180        allocate(hfmax_th(klon))
181        allocate(zmax_th(klon))
182        ! allocate arrays in "nonoro_gwd_ran_mod"
183        call ini_nonoro_gwd_ran(klon,klev)
184END SUBROUTINE phys_state_var_init
185
186!======================================================================
187SUBROUTINE phys_state_var_end
188
189IMPLICIT NONE
190
191        DEALLOCATE(tsurf)
192        DEALLOCATE(tsoil)
193        DEALLOCATE(albedo)
194        DEALLOCATE(albedo_equivalent)
195        DEALLOCATE(albedo_snow_SPECTV)
196        DEALLOCATE(albedo_co2_ice_SPECTV)
197        DEALLOCATE(albedo_bareground)
198        DEALLOCATE(rnat)
199        DEALLOCATE(emis)
200        DEALLOCATE(dtrad)
201        DEALLOCATE(fluxrad_sky)
202        DEALLOCATE(fluxrad)
203        DEALLOCATE(capcal)
204
205        DEALLOCATE(fluxgrd)
206        DEALLOCATE(qsurf)
207        DEALLOCATE(q2)
208        DEALLOCATE(ztprevious)
209        DEALLOCATE(zuprevious)
210        DEALLOCATE(cloudfrac)
211        DEALLOCATE(totcloudfrac)
212        DEALLOCATE(hice)
213        DEALLOCATE(qsurf_hist)
214        DEALLOCATE(reffrad)
215        DEALLOCATE(nueffrad)
216        DEALLOCATE(ice_initial)
217        DEALLOCATE(ice_min)
218        DEALLOCATE(fluxsurf_lw)
219        DEALLOCATE(fluxsurf_sw)
220        DEALLOCATE(fluxsurfabs_sw)
221        DEALLOCATE(fluxtop_lw)
222        DEALLOCATE(fluxabs_sw)
223        DEALLOCATE(fluxtop_dn)
224        DEALLOCATE(fluxdyn)
225        DEALLOCATE(OLR_nu)
226        DEALLOCATE(OSR_nu)
227        DEALLOCATE(int_dtaui)
228        DEALLOCATE(int_dtauv)
229        DEALLOCATE(sensibFlux)
230        DEALLOCATE(zdtlw)
231        DEALLOCATE(zdtsw)
232        DEALLOCATE(tau_col)
233        DEALLOCATE(pctsrf_sic)
234        DEALLOCATE(tslab)
235        DEALLOCATE(tsea_ice)
236        DEALLOCATE(sea_ice)
237        DEALLOCATE(zmasq)
238        DEALLOCATE(knindex)
239        DEALLOCATE(mu0)
240        DEALLOCATE(fract)
241        DEALLOCATE(glat)
242        DEALLOCATE(phisfi)
243        DEALLOCATE(albedodat)
244        DEALLOCATE(zmea)
245        DEALLOCATE(zstd)
246        DEALLOCATE(zsig)
247        DEALLOCATE(zgam)
248        DEALLOCATE(zthe)
249        !deallocate(l0)
250        deallocate(wstar)
251        deallocate(ustar)
252        deallocate(tstar)
253        deallocate(hfmax_th)
254        deallocate(zmax_th)
255        ! deallocate arrays in "nonoro_gwd_ran_mod"
256        call end_nonoro_gwd_ran
257
258END SUBROUTINE phys_state_var_end
259
260      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.