SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_teb_canopy.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 prep_teb_canopy (TCP, TG)
7 ! #################################################################################
8 !
9 !!**** *PREP_TEB_CANOPY* - prepares TEB canopy fields
10 !!
11 !! PURPOSE
12 !! -------
13 !
14 !!** METHOD
15 !! ------
16 !!
17 !! REFERENCE
18 !! ---------
19 !!
20 !!
21 !! AUTHOR
22 !! ------
23 !! V. Masson
24 !!
25 !! MODIFICATIONS
26 !! -------------
27 !! Original 07/2006
28 !! S. Riette 06/2009 XT, XU, XQ, XTKE are set to XUNDEF
29 !! No more argument needed
30 !! E. Martin 01/2012 XUNDEF fields are no more written in PREP file
31 !!------------------------------------------------------------------
32 !
33 !
34 !
35 !
37 USE modd_teb_grid_n, ONLY : teb_grid_t
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 !* 0.2 declarations of local variables
48 !
49 !
50 TYPE(teb_canopy_t), INTENT(INOUT) :: tcp
51 TYPE(teb_grid_t), INTENT(INOUT) :: tg
52 !
53 INTEGER :: jlayer
54 !
55 REAL, DIMENSION(:,:), ALLOCATABLE :: zzf ! altitudes at half levels
56 REAL(KIND=JPRB) :: zhook_handle
57 !
58 !-------------------------------------------------------------------------------------
59 !
60 IF (lhook) CALL dr_hook('PREP_TEB_CANOPY',0,zhook_handle)
61 !
62 !* 1. number of levels (MUST be at least equal to 2)
63 ! ----------------
64 !
65 tcp%NLVL = 6
66 !
67 !* 2. height of half levels (where turbulent fluxes will be)
68 ! ---------------------
69 !
70 !* Warning : ZZF(:,1) MUST BE ZERO
71 ALLOCATE(zzf(tg%NDIM,tcp%NLVL))
72 zzf(:,1) = 0.
73 zzf(:,2) = 1.
74 zzf(:,3) = 3.
75 zzf(:,4) = 5.
76 zzf(:,5) = 8.
77 zzf(:,6) = 12.
78 
79 ALLOCATE(tcp%XZ(tg%NDIM,tcp%NLVL))
80 DO jlayer=1,tcp%NLVL-1
81  tcp%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
82 END DO
83 tcp%XZ(:,tcp%NLVL) = 1.5 * zzf(:,tcp%NLVL) - 0.5 * zzf(:,tcp%NLVL-1)
84 !
85 DEALLOCATE(zzf)
86 !
87 IF (lhook) CALL dr_hook('PREP_TEB_CANOPY',1,zhook_handle)
88 !
89 !-------------------------------------------------------------------------------------
90 !
91 END SUBROUTINE prep_teb_canopy
subroutine prep_teb_canopy(TCP, TG)