SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_isba_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_isba_canopy (ICP, IG)
7 ! #################################################################################
8 !
9 !!**** *PREP_ISBA_CANOPY* - prepares ISBA 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 USE modd_isba_canopy_n, ONLY : isba_canopy_t
36 USE modd_isba_grid_n, ONLY : isba_grid_t
37 !
38 USE yomhook ,ONLY : lhook, dr_hook
39 USE parkind1 ,ONLY : jprb
40 !
41 IMPLICIT NONE
42 !
43 !* 0.1 declarations of arguments
44 !
45 !
46 !* 0.2 declarations of local variables
47 !
48 !
49 TYPE(isba_canopy_t), INTENT(INOUT) :: icp
50 TYPE(isba_grid_t), INTENT(INOUT) :: ig
51 !
52 INTEGER :: jlayer
53 !
54 REAL, DIMENSION(:,:), ALLOCATABLE :: zzf ! altitudes at half levels
55 REAL(KIND=JPRB) :: zhook_handle
56 !
57 !-------------------------------------------------------------------------------------
58 !
59 !
60 !* 1. number of levels (MUST be at least equal to 2)
61 ! ----------------
62 !
63 IF (lhook) CALL dr_hook('PREP_ISBA_CANOPY',0,zhook_handle)
64 icp%NLVL = 6
65 !
66 !* 2. height of half levels (where turbulent fluxes will be)
67 ! ---------------------
68 !
69 !* Warning : ZZF(:,1) MUST BE ZERO
70 ALLOCATE(zzf(ig%NDIM,icp%NLVL))
71 zzf(:,1) = 0.
72 zzf(:,2) = 1
73 zzf(:,3) = 3.
74 zzf(:,4) = 5.
75 zzf(:,5) = 8.
76 zzf(:,6) = 12.
77 
78 ALLOCATE(icp%XZ(ig%NDIM,icp%NLVL))
79 DO jlayer=1,icp%NLVL-1
80  icp%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
81 END DO
82 icp%XZ(:,icp%NLVL) = 1.5 * zzf(:,icp%NLVL) - 0.5 * zzf(:,icp%NLVL-1)
83 !
84 DEALLOCATE(zzf)
85 !
86 IF (lhook) CALL dr_hook('PREP_ISBA_CANOPY',1,zhook_handle)
87 !
88 !-------------------------------------------------------------------------------------
89 !
90 END SUBROUTINE prep_isba_canopy
subroutine prep_isba_canopy(ICP, IG)