SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
prep_watflux_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_watflux_sbl (WG, WSB)
7 ! #################################################################################
8 !
9 !!**** *PREP_WATFLUX_SBL* - prepares WATFLUX 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/2011 XUNDEF fields are no more written in PREP file
31 !!------------------------------------------------------------------
32 !
33 !
34 !
35 !
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(watflux_grid_t), INTENT(INOUT) :: wg
51 TYPE(watflux_sbl_t), INTENT(INOUT) :: wsb
52 !
53 INTEGER :: jlayer
54 !
55 REAL, DIMENSION(:,:), ALLOCATABLE :: zzf ! altitudes at half levels
56 REAL(KIND=JPRB) :: zhook_handle
57 !
58 !-------------------------------------------------------------------------------------
59 !
60 !* 1. number of levels (MUST be at least equal to 2)
61 ! ----------------
62 !
63 IF (lhook) CALL dr_hook('PREP_WATFLUX_SBL',0,zhook_handle)
64 wsb%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(wg%NDIM,wsb%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(wsb%XZ(wg%NDIM,wsb%NLVL))
79 DO jlayer=1,wsb%NLVL-1
80  wsb%XZ(:,jlayer) = 0.5 * (zzf(:,jlayer)+zzf(:,jlayer+1))
81 END DO
82 wsb%XZ(:,wsb%NLVL) = 1.5 * zzf(:,wsb%NLVL) - 0.5 * zzf(:,wsb%NLVL-1)
83 !
84 DEALLOCATE(zzf)
85 !
86 IF (lhook) CALL dr_hook('PREP_WATFLUX_SBL',1,zhook_handle)
87 !
88 !-------------------------------------------------------------------------------------
89 !
90 END SUBROUTINE prep_watflux_sbl
subroutine prep_watflux_sbl(WG, WSB)