SPEED
DPHI.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
28
29 function dphi(ng,csii,csij)
30
31 implicit real*8 (a-h,o-z)
32
33 integer*4 :: ng
34
35 call GET_LEGENDRE_VALUE_2DER(p2der2,p2,p2der,p1,p1der,ng,csii)
36 call GET_LEGENDRE_VALUE_2DER(q2der2,q2,q2der,q1,q1der,ng,csij)
37
38 if(abs(csij + 1.d0).le. 1.e-8 .and. abs(csii + 1.d0).le. 1.e-8) then
39 dphi = -(ng+1.d0)*ng/4.d0
40 elseif(abs(csij - 1.d0).le. 1.e-8 .and. abs(csii - 1.d0).le. 1.e-8) then
41 dphi = (ng+1.d0)*ng/4.d0
42 elseif(abs(csii - csij).le. 1.e-8) then
43 dphi = 0.d0
44 else
45 anum = (csij-csii)*ng*(ng+1.d0)*q2 + (1.d0-csij**2.d0)*q2der
46 aden = p2*ng*(ng+1.d0)*(csii - csij)**2.d0
47 dphi = anum/aden
48 endif
49
50 if(abs(dphi) .lt. 1.e-10) then
51 dphi = 0.d0
52 endif
53
54 return
55 end function dphi
56