SURFEX v8.1
General documentation of Surfex
prep_sbl.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_sbl (KDIM, SB)
7 ! #################################################################################
8 !
9 !!**** *PREP_SBL* - prepares FLAKE SBL 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 USE modd_canopy_n, ONLY : canopy_t
34 !
35 USE yomhook ,ONLY : lhook, dr_hook
36 USE parkind1 ,ONLY : jprb
37 !
38 IMPLICIT NONE
39 !
40 !* 0.1 declarations of arguments
41 !
42 !
43 !* 0.2 declarations of local variables
44 !
45 INTEGER, INTENT(IN) :: KDIM
46 TYPE(canopy_t), INTENT(INOUT) :: SB
47 !
48 INTEGER :: JLAYER
49 !
50 REAL, DIMENSION(:,:), ALLOCATABLE :: ZZF ! altitudes at half levels
51 REAL(KIND=JPRB) :: ZHOOK_HANDLE
52 !
53 !-------------------------------------------------------------------------------------
54 !
55 
56 !
57 !* 1. number of levels (MUST be at least equal to 2)
58 ! ----------------
59 !
60 IF (lhook) CALL dr_hook('PREP_SBL',0,zhook_handle)
61 sb%NLVL = 6
62 !
63 !* 2. height of half levels (where turbulent fluxes will be)
64 ! ---------------------
65 !
66 !* Warning : ZZF(:,1) MUST BE ZERO
67 ALLOCATE(zzf(kdim,sb%NLVL))
68 zzf(:,1) = 0.
69 zzf(:,2) = 1.
70 zzf(:,3) = 3.
71 zzf(:,4) = 5.
72 zzf(:,5) = 8.
73 zzf(:,6) = 12.
74 
75 ALLOCATE(sb%XZ(kdim,sb%NLVL))
76 DO jlayer=1,sb%NLVL-1
77  sb%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
78 END DO
79 sb%XZ(:,sb%NLVL) = 1.5 * zzf(:,sb%NLVL) - 0.5 * zzf(:,sb%NLVL-1)
80 !
81 DEALLOCATE(zzf)
82 !
83 IF (lhook) CALL dr_hook('PREP_SBL',1,zhook_handle)
84 !
85 !-------------------------------------------------------------------------------------
86 !
87 END SUBROUTINE prep_sbl
subroutine prep_sbl(KDIM, SB)
Definition: prep_sbl.F90:7
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15