PHYEX
0.9.5
PHYsique EXternalisée
Loading...
Searching...
No Matches
src
phyex
micro
hypser.F90
Go to the documentation of this file.
1
!MNH_LIC Copyright 1996-2024 CNRS, Meteo-France and Universite Paul Sabatier
2
!MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
3
!MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
4
!MNH_LIC for details. version 1.
5
!-----------------------------------------------------------------
6
!####################
7
MODULE
modi_hypser
8
!####################
9
!
10
IMPLICIT NONE
11
INTERFACE
12
!
13
SUBROUTINE
hypser
(PA,PB,PC,PX,PHYP)
14
IMPLICIT NONE
15
REAL
,
INTENT(IN)
:: PA,PB,PC
16
REAL
,
INTENT(IN)
:: PX
17
REAL
,
INTENT(INOUT)
:: PHYP
18
END SUBROUTINE
hypser
19
!
20
END INTERFACE
21
!
22
END MODULE
modi_hypser
23
! #############################################
24
SUBROUTINE
hypser
(PA,PB,PC,PX,PHYP)
25
! #############################################
26
!
27
!
28
!!**** *HYPSER* - hypergeometric function
29
!!
30
!!
31
!! PURPOSE
32
!! -------
33
! The purpose of this function is to compute the hypergeometric
34
!! function of its argument.
35
!!
36
!!
37
!! A*B (A+1)A*(B+1)B X^2
38
!! HYPSER(A,B,C,X)= 1 + ----- * X + ------------- * --- + ... +
39
!! C (C+1)C 2
40
!!
41
!! (A+n)...A*(B+n)...B X^n
42
!! --------------------- * ----- + ... ...
43
!! (C+n)...C n!
44
!!
45
!!** METHOD
46
!! ------
47
!!
48
!! EXTERNAL
49
!! --------
50
!! HYPSER
51
!!
52
!! IMPLICIT ARGUMENTS
53
!! ------------------
54
!!
55
!! REFERENCE
56
!! ---------
57
!! Press, Teukolsky, Vetterling and Flannery: Numerical Recipes, 272
58
!!
59
!!
60
!! AUTHOR
61
!! ------
62
!! Jean-Martial Cohard *LA/OMP*
63
!!
64
!! MODIFICATIONS
65
!! -------------
66
!! Original 31/12/96
67
! P. Wautelet 10/04/2019: replace ABORT and STOP calls by Print_msg
68
! P. Wautelet 26/04/2019: replace non-standard FLOAT function by REAL function
69
!
70
!------------------------------------------------------------------------------
71
!
72
!* 0. DECLARATIONS
73
!
74
!
75
USE
mode_msg
,
ONLY
:
print_msg
76
USE
modd_io
,
ONLY
:
nverb_fatal
77
!
78
IMPLICIT NONE
79
!
80
!* 0.1 declarations of arguments and result
81
!
82
REAL
,
INTENT(IN)
:: PA,PB,PC
83
REAL
,
INTENT(IN)
:: PX
84
REAL
,
INTENT(INOUT)
:: PHYP
85
!
86
!
87
!
88
!* 0.2 declarations of local variables
89
!
90
INTEGER
:: JN,JFLAG
91
REAL
:: ZXH,ZZA,ZZB,ZZC,ZFAC,ZTEMP
92
REAL
:: ZPREC
93
!
94
!------------------------------------------------------------------------------
95
!
96
zprec = 1.0e-04
97
zxh = px
98
zfac = 1.0
99
ztemp = zfac
100
zza = pa
101
zzb = pb
102
zzc = pc
103
jflag = 0
104
serie:
DO
jn = 1,5000
105
zfac = zfac * zza * zzb / zzc
106
zfac = zfac * zxh / real(jn)
107
phyp = ztemp + zfac
108
IF
(abs(phyp-ztemp).LE.zprec)
THEN
109
jflag = 1
110
EXIT
serie
111
END IF
112
ztemp = phyp
113
zza = zza + 1.
114
zzb = zzb + 1.
115
zzc = zzc + 1.
116
END DO
serie
117
IF
(jflag == 0)
call
print_msg
(
nverb_fatal
,
'GEN'
,
'HYPSER'
,
'convergence failure'
)
118
!
119
END SUBROUTINE
hypser
hypser
subroutine hypser(pa, pb, pc, px, phyp)
Definition
hypser.F90:25
mode_msg::print_msg
Definition
mode_msg.F90:15
modi_hypser::hypser
Definition
hypser.F90:13
modd_io
Definition
modd_io.F90:1
modd_io::nverb_fatal
integer, parameter nverb_fatal
Definition
modd_io.F90:6
mode_msg
Definition
mode_msg.F90:5
modi_hypser
Definition
hypser.F90:7
Generated by
1.15.0