SURFEX  V8_0
Surfex V8_0 release
 All Classes Files Functions Variables
cls_t.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 cls_t( PTA, PQA, PPA, PPS, PHT, &
7  pcd, pch, pri, &
8  pts, pz0h, ph, &
9  ptnm )
10 ! #####################################################################
11 !
12 !!**** *PARAMCLS*
13 !!
14 !! PURPOSE
15 !! -------
16 !
17 !
18 !
19 !!** METHOD
20 !! ------
21 !
22 !! EXTERNAL
23 !! --------
24 !!
25 !! none
26 !!
27 !! IMPLICIT ARGUMENTS
28 !! ------------------
29 !!
30 !! USE MODD_CST
31 !! USE MODD_GROUND_PAR
32 !!
33 !!
34 !! REFERENCE
35 !! ---------
36 !!
37 !!
38 !! AUTHOR
39 !! ------
40 !!
41 !!
42 !! MODIFICATIONS
43 !! -------------
44 !!
45 !! Original 26/10/98
46 !! S. Riette 06/2009 CLS_2M becomes CLS_TQ, height now is an argument
47 !-------------------------------------------------------------------------------
48 !
49 !* 0. DECLARATIONS
50 ! ------------
51 !
52 USE modd_csts, ONLY : xg, xcpd, xkarman
53 USE modd_surf_par, ONLY : xundef
54 !
55 USE mode_thermos
56 !
57 !
58 USE yomhook ,ONLY : lhook, dr_hook
59 USE parkind1 ,ONLY : jprb
60 !
61 IMPLICIT NONE
62 !
63 !* 0.1 declarations of arguments
64 !
65 !
66 !
67 REAL, DIMENSION(:), INTENT(IN) :: pta ! atmospheric temperature
68 REAL, DIMENSION(:), INTENT(IN) :: pqa ! atmospheric humidity (kg/kg)
69 REAL, DIMENSION(:), INTENT(IN) :: ppa ! atmospheric level pressure
70 REAL, DIMENSION(:), INTENT(IN) :: pps ! surface pressure
71 REAL, DIMENSION(:), INTENT(IN) :: pht ! atmospheric level height (temp)
72 REAL, DIMENSION(:), INTENT(IN) :: pcd ! drag coefficient for momentum
73 REAL, DIMENSION(:), INTENT(IN) :: pch ! drag coefficient for heat
74 REAL, DIMENSION(:), INTENT(IN) :: pri ! Richardson number
75 REAL, DIMENSION(:), INTENT(IN) :: pts ! surface temperature
76 REAL, DIMENSION(:), INTENT(IN) :: pz0h ! roughness length for heat
77 REAL, DIMENSION(:), INTENT(IN) :: ph ! height of diagnostic
78 !
79 REAL, DIMENSION(:), INTENT(OUT) :: ptnm ! temperature at n meters
80 !
81 !* 0.2 declarations of local variables
82 !
83 REAL, DIMENSION(SIZE(PTA)) :: zbnh,zbh,zrs
84 REAL, DIMENSION(SIZE(PTA)) :: zlogs,zcors,ziv
85  CHARACTER(LEN=2) :: yhumidity
86 REAL(KIND=JPRB) :: zhook_handle
87 !
88 !-------------------------------------------------------------------------------
89 !
90 IF (lhook) CALL dr_hook('CLS_T',0,zhook_handle)
91 ptnm(:) = xundef
92 !
93 zbnh(:) = 0.
94 zbh(:) = 0.
95 zrs(:) = 0.
96 zlogs(:) = 0.
97 zcors(:) = 0.
98 ziv(:) = 0.
99 !
100 !* 1. preparatory calculations
101 ! ------------------------
102 !
103 zbnh(:)=log( pht(:)/pz0h(:))
104 !
105 zbh(:)=xkarman*sqrt( pcd(:) )/pch(:)
106 !
107 zrs(:)=min(ph/pht(:),1.)
108 !
109 zlogs(:)=log(1.+zrs(:)*(exp(zbnh(:)) -1.))
110 !
111 !* 2. Stability effects
112 ! -----------------
113 !
114 WHERE (pri(:)>=0.)
115  zcors(:)=zrs(:)*(zbnh(:)-zbh(:))
116 END WHERE
117 !
118 WHERE (pri(:)< 0.)
119  zcors(:)=log(1.+zrs(:)*(exp(max(0.,zbnh(:)-zbh(:)))-1.))
120 END WHERE
121 !
122 !* 3. Interpolation of thermodynamical variables
123 ! ------------------------------------------
124 !
125 ziv=max(0.,min(1.,(zlogs(:)-zcors(:))/zbh(:)))
126 ptnm(:)=pts(:)+ziv(:)*(pta(:)-pts(:))
127 !
128 IF (lhook) CALL dr_hook('CLS_T',1,zhook_handle)
129 !
130 !-------------------------------------------------------------------------------
131 !
132 END SUBROUTINE cls_t
subroutine cls_t(PTA, PQA, PPA, PPS, PHT, PCD, PCH, PRI, PTS, PZ0H, PH, PTNM)
Definition: cls_t.F90:6