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

Last change on this file since 3556 was 3397, checked in by bhatnags, 6 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
RevLine 
[1835]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
[3100]15!      use slab_ice_h, only : noceanmx
16      USE ocean_slab_mod, ONLY: nslay
[1835]17      USE radinc_h, only : L_NSPECTI, L_NSPECTV,naerkind
18      use surfdat_h, only: phisfi, albedodat,  &
19                        zmea, zstd, zsig, zgam, zthe
[1883]20      use turb_mod, only: q2,sensibFlux,wstar,ustar,tstar,hfmax_th,zmax_th
[2299]21      use nonoro_gwd_ran_mod, only: ini_nonoro_gwd_ran, end_nonoro_gwd_ran
[1883]22
[1835]23      real,allocatable,dimension(:,:),save :: ztprevious ! Previous loop Atmospheric Temperature (K)
24! Useful for Dynamical Heating calculation.
25      real,allocatable,dimension(:,:),save :: zuprevious
[1883]26!$OMP THREADPRIVATE(ztprevious,zuprevious)
27
[1835]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.
[2485]32      real, dimension(:),allocatable,save :: albedo_equivalent1     ! Spectral Mean albedo clear sky.
[1835]33      real, dimension(:),allocatable,save :: albedo_snow_SPECTV    ! Snow Spectral albedo.
34      real, dimension(:),allocatable,save :: albedo_co2_ice_SPECTV ! CO2 ice Spectral albedo.
[2485]35!$OMP THREADPRIVATE(tsurf,tsoil,albedo,albedo_equivalent,albedo_equivalent1,albedo_snow_SPECTV,albedo_co2_ice_SPECTV)
[1835]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).
[1883]48!$OMP THREADPRIVATE(emis,dtrad,fluxrad_sky,fluxrad,capcal,fluxgrd,qsurf)
[1835]49
50      ! FOR DIAGNOSTIC :
51
52      real,dimension(:),allocatable,save :: fluxsurf_lw     ! Incident Long Wave (IR) surface flux (W.m-2).
[2485]53      real,dimension(:),allocatable,save :: fluxsurf_lw1     ! Incident Long Wave (IR) surface flux (W.m-2) clear sky.
[1835]54      real,dimension(:),allocatable,save :: fluxsurf_sw     ! Incident Short Wave (stellar) surface flux (W.m-2).
[2485]55      real,dimension(:),allocatable,save :: fluxsurf_sw1     ! Incident Short Wave (stellar) surface flux (W.m-2) clear sky.
[1835]56      real,dimension(:),allocatable,save :: fluxsurfabs_sw  ! Absorbed Short Wave (stellar) flux by the surface (W.m-2).
[2485]57!$OMP THREADPRIVATE(fluxsurf_lw,fluxsurf_lw1,fluxsurf_sw,fluxsurf_sw1,fluxsurfabs_sw)
[1883]58
[1835]59      real,dimension(:),allocatable,save :: fluxtop_lw      ! Outgoing LW (IR) flux to space (W.m-2).
[2485]60      real,dimension(:),allocatable,save :: fluxtop_lw1      ! Outgoing LW (IR) flux to space (W.m-2) clear sky.
[1835]61      real,dimension(:),allocatable,save :: fluxabs_sw      ! Absorbed SW (stellar) flux (W.m-2).
[2485]62      real,dimension(:),allocatable,save :: fluxabs_sw1      ! Absorbed SW (stellar) flux (W.m-2) clear sky.
[1835]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).
[2485]65!$OMP THREADPRIVATE(fluxtop_lw,fluxtop_lw1,fluxabs_sw,fluxabs_sw1,fluxtop_dn,fluxdyn)
[1883]66
[1835]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)).
[2537]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)).
[1835]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).
[2537]73!$OMP THREADPRIVATE(OLR_nu,OSR_nu,GSR_nu,zdtlw,zdtsw)
[1835]74
[2133]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
[1835]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
[1883]89!$OMP THREADPRIVATE(qsurf_hist,nueffrad)
[1835]90
[2485]91      real,dimension(:),allocatable,save ::  pctsrf_sic
92      real,dimension(:,:),allocatable,save :: tslab        ! Slab_ocean temperature (K)
[3100]93      real,dimension(:),allocatable,save ::  tsea_ice      ! Temperature of the top layer (K), either snow or ice
[3397]94!      real,dimension(:),allocatable,save :: tice           ! Sea ice temperature (K)
[2485]95      real,dimension(:),allocatable,save :: sea_ice
96      real,dimension(:),allocatable,save :: zmasq
97      integer,dimension(:),allocatable,save ::knindex
[1835]98      real,allocatable,dimension(:,:,:),save :: reffrad
[2485]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)
[2550]107!$OMP THREADPRIVATE(dEzdiff,dEdiff,dEdiffs,dEzRadsw,dEzRadlw)
[2485]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)
[1842]114     
[2714]115      real,dimension(:),allocatable,save :: genericconddE ! Heat from generic condensation (W.m-2)
116!$OMP THREADPRIVATE(genericconddE)
117
[2485]118      real,dimension(:),allocatable,save :: H2Omaxcol ! Maximum possible H2O column amount (at 100% saturation) (kg.m-2).
119!$OMP THREADPRIVATE(H2Omaxcol)
120     
[1835]121CONTAINS
122
123!======================================================================
[1842]124SUBROUTINE phys_state_var_init(nqtot)
[1835]125
126IMPLICIT NONE
127
[1883]128        integer,intent(in) :: nqtot
[1842]129
[1835]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
[2485]140
[1835]141        ALLOCATE(phisfi(klon))
142        ALLOCATE(tsurf(klon))
143        ALLOCATE(tsoil(klon,nsoilmx))
144        ALLOCATE(albedo(klon,L_NSPECTV))
145        ALLOCATE(albedo_equivalent(klon))
[2485]146        ALLOCATE(albedo_equivalent1(klon))
[1835]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))
[2485]157        ALLOCATE(fluxgrdocean(klon))
[1835]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))
[2485]169        ALLOCATE(fluxsurf_lw1(klon))
[1835]170        ALLOCATE(fluxsurf_sw(klon))
[2485]171        ALLOCATE(fluxsurf_sw1(klon))
[1835]172        ALLOCATE(fluxsurfabs_sw(klon))
173        ALLOCATE(fluxtop_lw(klon))
[2485]174        ALLOCATE(fluxtop_lw1(klon))
[1835]175        ALLOCATE(fluxabs_sw(klon))
[2485]176        ALLOCATE(fluxabs_sw1(klon))
[1835]177        ALLOCATE(fluxtop_dn(klon))
178        ALLOCATE(fluxdyn(klon))
179        ALLOCATE(OLR_nu(klon,L_NSPECTI))
180        ALLOCATE(OSR_nu(klon,L_NSPECTV))
[2537]181        ALLOCATE(GSR_nu(klon,L_NSPECTV))
[2133]182        ALLOCATE(int_dtaui(klon,klev,L_NSPECTI))
183        ALLOCATE(int_dtauv(klon,klev,L_NSPECTV))
[1835]184        ALLOCATE(sensibFlux(klon))
185        ALLOCATE(zdtlw(klon,klev))
186        ALLOCATE(zdtsw(klon,klev))
187        ALLOCATE(tau_col(klon))
188        ALLOCATE(pctsrf_sic(klon))
[3100]189        ALLOCATE(tslab(klon,nslay))
[1835]190        ALLOCATE(tsea_ice(klon))
[3100]191!        ALLOCATE(tice(klon))
[1835]192        ALLOCATE(sea_ice(klon))
193        ALLOCATE(zmasq(klon))
194        ALLOCATE(knindex(klon))
[2485]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))
[2714]204        ALLOCATE(genericconddE(klon))
[2485]205        ALLOCATE(H2Omaxcol(klon))
[1835]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))
[2299]223        ! allocate arrays in "nonoro_gwd_ran_mod"
224        call ini_nonoro_gwd_ran(klon,klev)
[1835]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)
[2485]236        DEALLOCATE(albedo_equivalent1)
[1835]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)
[2485]248        DEALLOCATE(fluxgrdocean)
[1835]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)
[2485]260        DEALLOCATE(fluxsurf_lw1)
[1835]261        DEALLOCATE(fluxsurf_sw)
[2485]262        DEALLOCATE(fluxsurf_sw1)
[1835]263        DEALLOCATE(fluxsurfabs_sw)
264        DEALLOCATE(fluxtop_lw)
[2485]265        DEALLOCATE(fluxtop_lw1)
[1835]266        DEALLOCATE(fluxabs_sw)
[2485]267        DEALLOCATE(fluxabs_sw1)
[1835]268        DEALLOCATE(fluxtop_dn)
269        DEALLOCATE(fluxdyn)
270        DEALLOCATE(OLR_nu)
271        DEALLOCATE(OSR_nu)
[2537]272        DEALLOCATE(GSR_nu)
[2133]273        DEALLOCATE(int_dtaui)
274        DEALLOCATE(int_dtauv)
[1835]275        DEALLOCATE(sensibFlux)
276        DEALLOCATE(zdtlw)
277        DEALLOCATE(zdtsw)
278        DEALLOCATE(tau_col)
279        DEALLOCATE(pctsrf_sic)
280        DEALLOCATE(tslab)
281        DEALLOCATE(tsea_ice)
[3100]282 !       DEALLOCATE(tice)
[1835]283        DEALLOCATE(sea_ice)
284        DEALLOCATE(zmasq)
285        DEALLOCATE(knindex)
[2485]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)
[2714]295        DEALLOCATE(genericconddE)
[2485]296        DEALLOCATE(H2Omaxcol)       
[1835]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)
[2299]313        ! deallocate arrays in "nonoro_gwd_ran_mod"
314        call end_nonoro_gwd_ran
[1835]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.