SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
set_sso_levels.F90
Go to the documentation of this file.
1 !SFX_LIC Copyright 1994-2014 CNRS, Meteo-France and Universite Paul Sabatier
2 !SFX_LIC This is part of the SURFEX software governed by the CeCILL-C licence
3 !SFX_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4 !SFX_LIC for details. version 1.
5 ! #################################################################################
6 SUBROUTINE set_sso_levels (SSCP, &
7  kdim)
8 ! #################################################################################
9 !
10 !!**** *SET_SSO_LEVELS* - prepares SSO canopy fields
11 !!
12 !! PURPOSE
13 !! -------
14 !
15 !!** METHOD
16 !! ------
17 !!
18 !! REFERENCE
19 !! ---------
20 !!
21 !!
22 !! AUTHOR
23 !! ------
24 !! V. Masson
25 !!
26 !! MODIFICATIONS
27 !! -------------
28 !! Original 07/2006
29 !! S. Riette 06/2009 XT, XU, XQ, XTKE are set to XUNDEF
30 !! No more argument needed
31 !! E. Martin 01/2012 XUNDEF fields are no more written in PREP file
32 !!------------------------------------------------------------------
33 !
34 !
36 !
37 USE modd_surf_par, ONLY : xundef
38 !
39 USE yomhook ,ONLY : lhook, dr_hook
40 USE parkind1 ,ONLY : jprb
41 !
42 IMPLICIT NONE
43 !
44 !* 0.1 declarations of arguments
45 !
46 !
47 TYPE(sso_canopy_t), INTENT(INOUT) :: sscp
48 !
49 INTEGER, INTENT(IN) :: kdim ! 1D physical dimension
50 
51 !
52 !* 0.2 declarations of local variables
53 !
54 INTEGER :: jlayer
55 INTEGER :: ilu ! number of points
56 !
57 REAL, DIMENSION(:,:), ALLOCATABLE :: zzf ! altitudes at half levels
58 REAL(KIND=JPRB) :: zhook_handle
59 !
60 !-------------------------------------------------------------------------------------
61 !
62 !* 1. number of levels (MUST be at least equal to 2)
63 ! ----------------
64 !
65 IF (lhook) CALL dr_hook('SET_SSO_LEVELS',0,zhook_handle)
66 sscp%NLVL = 6
67 !
68 !* 2. height of half levels (where turbulent fluxes will be)
69 ! ---------------------
70 !
71 !* Warning : ZZF(:,1) MUST BE ZERO
72 ALLOCATE(zzf(kdim,sscp%NLVL))
73 zzf(:,1) = 0.
74 zzf(:,2) = 1
75 zzf(:,3) = 3.
76 zzf(:,4) = 5.
77 zzf(:,5) = 8.
78 zzf(:,6) = 12.
79 
80 ALLOCATE(sscp%XZ(kdim,sscp%NLVL))
81 DO jlayer=1,sscp%NLVL-1
82  sscp%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
83 END DO
84 sscp%XZ(:,sscp%NLVL) = 1.5 * zzf(:,sscp%NLVL) - 0.5 * zzf(:,sscp%NLVL-1)
85 !
86 DEALLOCATE(zzf)
87 !
88 !* 3. wind in canopy (m/s)
89 ! --------------
90 !
91 ALLOCATE(sscp%XU(kdim,sscp%NLVL))
92 sscp%XU(:,:) = xundef
93 !
94 !* 4. Tke in canopy (m2/s2)
95 ! -------------
96 !
97 ALLOCATE(sscp%XTKE(kdim,sscp%NLVL))
98 sscp%XTKE(:,:) = xundef
99 !
100 IF (lhook) CALL dr_hook('SET_SSO_LEVELS',1,zhook_handle)
101 !
102 !-------------------------------------------------------------------------------------
103 !
104 END SUBROUTINE set_sso_levels
subroutine set_sso_levels(SSCP, KDIM)