SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
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,KLVL,PZ,PZF,PDZ,PDZF)
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 !
60 USE yomhook ,ONLY : lhook, dr_hook
61 USE parkind1 ,ONLY : jprb
62 !
63 IMPLICIT NONE
64 !
65 !* 0.1 Declarations of arguments
66 ! -------------------------
67 !
68 INTEGER, INTENT(IN) :: ki ! number of horizontal points
69 INTEGER, INTENT(IN) :: klvl ! number of levels in canopy
70 REAL, DIMENSION(KI,KLVL), INTENT(IN) :: pz ! heights of canopy levels (m)
71 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pzf ! heights of surface between canopy lev.(m)
72 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdzf ! depth between 2 full canopy levels (m)
73 ! ! PDZF is located at half levels
74 REAL, DIMENSION(KI,KLVL), INTENT(OUT) :: pdz ! depth between 2 half canopy levels (m)
75 ! ! PDZ is located at full levels
76 !
77 !
78 !* 0.2 Declarations of local variables
79 ! -------------------------------
80 !
81 INTEGER :: jlayer ! loop counter on layers
82 REAL(KIND=JPRB) :: zhook_handle
83 !
84 !-------------------------------------------------------------------------------
85 !
86 !* 1. Geometric computations
87 ! ----------------------
88 !
89 !
90 !* 1.1 layer depths (variable located at half levels below full levels)
91 ! ------------
92 !
93 IF (lhook) CALL dr_hook('CANOPY_GRID',0,zhook_handle)
94 pdzf(:,:) = -999.
95 pdzf(:,1) = 2.*pz(:,1)
96 DO jlayer=2,klvl
97  pdzf(:,jlayer) = pz(:,jlayer) - pz(:,jlayer-1)
98 END DO
99 !
100 !* 1.2 Layer heights (variable located at half levels below full levels)
101 ! -------------
102 !
103 pzf(:,:) = -999.
104 pzf(:,1) = 0.
105 DO jlayer=2,klvl
106  pzf(:,jlayer) = 2.*pz(:,jlayer-1) - pzf(:,jlayer-1)
107 END DO
108 !
109 !
110 !* 1.3 layer depths (variable located at full levels)
111 ! ------------
112 !
113 pdz(:,:) = -999.
114 DO jlayer=1,klvl-1
115  pdz(:,jlayer) = pzf(:,jlayer+1) - pzf(:,jlayer)
116 END DO
117 pdz(:,klvl) = 2.*(pz(:,klvl)-pzf(:,klvl))
118 IF (lhook) CALL dr_hook('CANOPY_GRID',1,zhook_handle)
119 !
120 !-------------------------------------------------------------------------------
121 END SUBROUTINE canopy_grid
subroutine canopy_grid(KI, KLVL, PZ, PZF, PDZ, PDZF)
Definition: canopy_grid.F90:6