SURFEX v8.1
General documentation of Surfex
canopy_grid.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 canopy_grid(KI,SB)
7 ! #########################################
8 !
9 !!**** *CANOPY_GRID* - computation of vertical grid coordinatesa at
10 !! half levels and grid depths at half and full
11 !! levels
12 !!
13 !!
14 !! PURPOSE
15 !! -------
16 !!
17 !!** METHOD
18 !! ------
19 !!
20 !
21 !
22 ! --------------------------------- PZ(k+1) PDZ(k+1)
23 ! ^
24 ! |
25 ! |
26 ! - - - - - - - - - - - - - - - - - PZf(k+1) | PDZf(k+1)
27 ! ^ |
28 ! | |
29 ! --------------------------------- PZ(k), XU, XT, XQ, XTKE | PDZ(k) V
30 ! | ^
31 ! - - - - - - - - - - - - - - - - - PZf(k) V | PDZf(k)
32 ! --------------------------------- PZ(k-1) PDZ(k-1) V
33 ! - - - - - - - - - - - - - - - - - PZf(k-1)
34 !
35 
36 !! EXTERNAL
37 !! --------
38 !!
39 !!
40 !! IMPLICIT ARGUMENTS
41 !! ------------------
42 !!
43 !! REFERENCE
44 !! ---------
45 !!
46 !!
47 !! AUTHOR
48 !! ------
49 !! V. Masson *Meteo France*
50 !!
51 !! MODIFICATIONS
52 !! -------------
53 !! Original 07/2006
54 !-------------------------------------------------------------------------------
55 !
56 !* 0. DECLARATIONS
57 ! ------------
58 !
59 USE modd_canopy_n, ONLY : canopy_t
60 !
61 USE yomhook ,ONLY : lhook, dr_hook
62 USE parkind1 ,ONLY : jprb
63 !
64 IMPLICIT NONE
65 !
66 !* 0.1 Declarations of arguments
67 ! -------------------------
68 !
69 INTEGER, INTENT(IN) :: KI ! number of horizontal points
70 !
71 TYPE(canopy_t), INTENT(INOUT) :: SB
72 !
73 !* 0.2 Declarations of local variables
74 ! -------------------------------
75 !
76 INTEGER :: JLAYER ! loop counter on layers
77 REAL(KIND=JPRB) :: ZHOOK_HANDLE
78 !
79 !-------------------------------------------------------------------------------
80 !
81 IF (lhook) CALL dr_hook('CANOPY_GRID',0,zhook_handle)
82 !
83 !* 1. Geometric computations
84 ! ----------------------
85 !
86 !
87 !* 1.1 layer depths (variable located at half levels below full levels)
88 ! ------------
89 !
90 sb%XDZF(:,:) = -999.
91 sb%XDZF(:,1) = 2.*sb%XZ(:,1)
92 DO jlayer=2,sb%NLVL
93  sb%XDZF(:,jlayer) = sb%XZ(:,jlayer) - sb%XZ(:,jlayer-1)
94 END DO
95 !
96 !* 1.2 Layer heights (variable located at half levels below full levels)
97 ! -------------
98 !
99 sb%XZF(:,:) = -999.
100 sb%XZF(:,1) = 0.
101 DO jlayer=2,sb%NLVL
102  sb%XZF(:,jlayer) = 2.*sb%XZ(:,jlayer-1) - sb%XZF(:,jlayer-1)
103 END DO
104 !
105 !
106 !* 1.3 layer depths (variable located at full levels)
107 ! ------------
108 !
109 sb%XDZ(:,:) = -999.
110 DO jlayer=1,sb%NLVL-1
111  sb%XDZ(:,jlayer) = sb%XZF(:,jlayer+1) - sb%XZF(:,jlayer)
112 END DO
113 !
114 sb%XDZ(:,sb%NLVL) = 2.*(sb%XZ(:,sb%NLVL)-sb%XZF(:,sb%NLVL))
115 !
116 IF (lhook) CALL dr_hook('CANOPY_GRID',1,zhook_handle)
117 !
118 !-------------------------------------------------------------------------------
119 END SUBROUTINE canopy_grid
integer, parameter jprb
Definition: parkind1.F90:32
logical lhook
Definition: yomhook.F90:15
subroutine canopy_grid(KI, SB)
Definition: canopy_grid.F90:7