SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_flake_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_flake_sbl (FG, FSB)
7 ! #################################################################################
8 !
9 !!**** *PREP_FLAKE_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 !
34 !
35 !
37 USE modd_flake_sbl_n, ONLY : flake_sbl_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(flake_grid_t), INTENT(INOUT) :: fg
51 TYPE(flake_sbl_t), INTENT(INOUT) :: fsb
52 !
53 INTEGER :: jlayer
54 !
55 REAL, DIMENSION(:,:), ALLOCATABLE :: zzf ! altitudes at half levels
56 REAL(KIND=JPRB) :: zhook_handle
57 !
58 !-------------------------------------------------------------------------------------
59 !
60 
61 !
62 !* 1. number of levels (MUST be at least equal to 2)
63 ! ----------------
64 !
65 IF (lhook) CALL dr_hook('PREP_FLAKE_SBL',0,zhook_handle)
66 fsb%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(fg%NDIM,fsb%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(fsb%XZ(fg%NDIM,fsb%NLVL))
81 DO jlayer=1,fsb%NLVL-1
82  fsb%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
83 END DO
84 fsb%XZ(:,fsb%NLVL) = 1.5 * zzf(:,fsb%NLVL) - 0.5 * zzf(:,fsb%NLVL-1)
85 !
86 DEALLOCATE(zzf)
87 !
88 IF (lhook) CALL dr_hook('PREP_FLAKE_SBL',1,zhook_handle)
89 !
90 !-------------------------------------------------------------------------------------
91 !
92 END SUBROUTINE prep_flake_sbl
subroutine prep_flake_sbl(FG, FSB)