SURFEX v8.1
General documentation of Surfex
Surfex_Git2
src
SURFEX
mode_cotwo.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
MODULE
mode_cotwo
7
! ##################
8
!
9
!!**** *MODE_COTWO * - contains some needed computations for vegetation
10
!!
11
!! PURPOSE
12
!! -------
13
!
14
!!** METHOD
15
!! ------
16
!!
17
!! EXTERNAL
18
!! --------
19
!!
20
!! IMPLICIT ARGUMENTS
21
!! ------------------
22
!!
23
!! REFERENCE
24
!! ---------
25
!!
26
!! AUTHOR
27
!! ------
28
!! A. Boone * Meteo France *
29
!!
30
!! MODIFICATIONS
31
!! -------------
32
!! Original 05/03/15
33
!-----------------------------------------------------------------------------
34
!
35
!* 0. DECLARATIONS
36
!
37
!
38
INTERFACE
gauleg
39
MODULE PROCEDURE
gauleg
40
END INTERFACE
41
!
42
!
43
!-------------------------------------------------------------------------------
44
CONTAINS
45
!
46
!####################################################################
47
!####################################################################
48
!####################################################################
49
SUBROUTINE
gauleg
(PX1,PX2,PX,PW,KN)
50
!
51
!
52
!!**** *GAULEG*
53
!!
54
!! PURPOSE
55
!! -------
56
!
57
! Calculates the Gaussian weights for integration of net assimilation
58
! and stomatal conductance over the canopy depth
59
!
60
!
61
!!** METHOD
62
!! ------
63
!
64
! 1) Calculate the weights and abscissa using Gaussian Quadrature
65
!
66
!! EXTERNAL
67
!! --------
68
!! none
69
!!
70
!! IMPLICIT ARGUMENTS
71
!! ------------------
72
!! MODD_CST
73
!!
74
!! REFERENCE
75
!! ---------
76
!!
77
!! Calvet et al. (1998) For. Agri. Met.
78
!!
79
!! AUTHOR
80
!! ------
81
!!
82
!! A. Boone * Meteo-France *
83
!! (following Belair)
84
!!
85
!! MODIFICATIONS
86
!! -------------
87
!! Original 27/10/97
88
!!
89
!-------------------------------------------------------------------------------
90
!
91
!
92
!* 0. DECLARATIONS
93
! ------------
94
!
95
USE
modd_csts
, ONLY
:
xpi
96
!
97
USE
yomhook
,ONLY
:
lhook
,
dr_hook
98
USE
parkind1
,ONLY
:
jprb
99
!
100
IMPLICIT NONE
101
!
102
!* 0.1 declarations of arguments
103
!
104
INTEGER
,
INTENT(IN)
:: KN
105
! number of points at which Gaussian
106
! weights are evaluated/needed
107
!
108
REAL
,
INTENT(IN)
:: PX1, PX2
109
! mathematical/numerical values needed for
110
! weight computation
111
!
112
REAL
,
DIMENSION(KN)
,
INTENT(OUT)
:: PX, PW
113
! PX = abscissa
114
! PW = Gaussian weights
115
!
116
!
117
!* 0.2 declarations of local variables
118
!
119
REAL
,
PARAMETER
:: PPEPS = 3.0e-14
120
! convergence criteria
121
!
122
INTEGER
JI,JJ,JK
! loop indexes
123
!
124
INTEGER
IM
!
125
!
126
REAL
ZXM, ZXL, ZZ, ZP1, ZP2, ZP3, ZPP, ZZ1
! dummy variables needed for
127
!
128
REAL(KIND=JPRB)
:: ZHOOK_HANDLE
129
! computation of the gaussian weights
130
!
131
!-------------------------------------------------------------------------------
132
!
133
! calcul des poids et abscisses par la methode de quad de Gauss
134
!
135
IF
(
lhook
)
CALL
dr_hook
(
'GAULEG'
,0,zhook_handle)
136
!
137
im = (kn+1)/2
138
zxm = 0.50*(px2+px1)
139
zxl = 0.50*(px2-px1)
140
!
141
im_point_loop:
DO
ji = 1,im
142
zz = cos(
xpi
*(float(ji)-.250)/(float(kn)+.50))
143
!
144
! begin iteration:
145
!
146
iteration_loop:
DO
jk = 1,100
147
zp1 = 1.
148
zp2 = 0.
149
DO
jj = 1,kn
150
zp3 = zp2
151
zp2 = zp1
152
zp1 = ((2.*(jj)-1.)*zz*zp2-(float(jj)-1.)*zp3)/jj
153
END DO
154
zpp = float(kn)*(zz*zp1-zp2)/(zz*zz-1.)
155
zz1 = zz
156
zz = zz1-zp1/zpp
157
IF
(abs(zz-zz1).LE.ppeps)
EXIT
158
END DO
iteration_loop
159
!
160
! end iteration.
161
!
162
! compute abscissa
163
!
164
px(ji) = zxm - zxl*zz
165
px(kn+1-ji) = zxm + zxl*zz
166
!
167
! compute weights
168
!
169
pw(ji) = 2.0*zxl/((1.0-zz*zz)*zpp*zpp)
170
pw(kn+1-ji) = pw(ji)
171
END DO
im_point_loop
172
!
173
IF
(
lhook
)
CALL
dr_hook
(
'GAULEG'
,1,zhook_handle)
174
!
175
!
176
END SUBROUTINE
gauleg
177
!####################################################################
178
!####################################################################
179
!####################################################################
180
!
181
END MODULE
mode_cotwo
yomhook::dr_hook
Definition:
yomhook.F90:20
modd_csts::xpi
real, save xpi
Definition:
modd_csts.F90:43
mode_cotwo
Definition:
mode_cotwo.F90:6
parkind1::jprb
integer, parameter jprb
Definition:
parkind1.F90:32
yomhook::lhook
logical lhook
Definition:
yomhook.F90:15
parkind1
Definition:
parkind1.F90:1
modd_csts
Definition:
modd_csts.F90:6
mode_cotwo::gauleg
Definition:
mode_cotwo.F90:38
yomhook
Definition:
yomhook.F90:1
Generated on Tue Jan 16 2018 16:23:29 for SURFEX v8.1 by
1.8.13