File indexing completed on 2018-03-02 18:41:03 UTC
view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
8e4c181d69 Jean*0001 # include "GAD_OPTIONS.h"
0002
0003
0004
0005
0006
0007
0008
0009
0010 SUBROUTINE GAD_PLM_FUN_U(
0011 I ffll,ff00,ffrr,
0012 O dfds)
0013
0014
0015
0016
0017
0018 implicit none
0019
0020
0021 _RL ffll,ff00,ffrr
0022 _RL dfds(-1:+1)
0023
0024
0025 _RL fell,ferr,scal
0026 _RL epsil
0027 PARAMETER( epsil = 1. _d -16 )
0028
0029 dfds(-1) = ff00 - ffll
0030 dfds(+1) = ffrr - ff00
0031
0032 if (dfds(-1) * dfds(+1) .gt. 0.0 _d 0) then
0033
0034
0035 fell = 0.5 _d 0 * (ffll + ff00)
0036 ferr = 0.5 _d 0 * (ff00 + ffrr)
0037
0038
0039 dfds(+0) =
0040 & 0.5 _d 0 * (ferr - fell)
0041
0042
0043 scal = min(abs(dfds(-1)),
0044 & abs(dfds(+1)))
0045 & / max(abs(dfds(+0)), epsil)
0046
0047 scal = min(scal, 1.0 _d 0)
0048
0049 dfds(+0) = scal * dfds(+0)
0050
0051 else
0052
0053
0054 dfds(+0) = 0.0 _d 0
0055
0056 end if
0057
0058 dfds(-1) = 0.5 _d 0 * dfds(-1)
0059 dfds(+1) = 0.5 _d 0 * dfds(+1)
0060
0061 return
0062
0063
0064 end
0065
0066
0067
0068 SUBROUTINE GAD_PLM_FUN_V(
0069 I ffll,ff00,ffrr,
0070 I ddll,dd00,ddrr,
0071 O dfds)
0072
0073
0074
0075
0076
0077 implicit none
0078
0079
0080 _RL ffll,ff00,ffrr
0081 _RL ddll,dd00,ddrr
0082 _RL dfds(-1:+1)
0083
0084
0085 _RL fell,ferr,scal
0086 _RL epsil
0087 PARAMETER( epsil = 1. _d -16 )
0088
0089 dfds(-1) = ff00 - ffll
0090 dfds(+1) = ffrr - ff00
0091
0092 if (dfds(-1) * dfds(+1) .gt. 0.0 _d 0) then
0093
0094
0095 fell = (dd00 * ffll + ddll * ff00)
0096 & / (ddll + dd00)
0097 ferr = (ddrr * ff00 + dd00 * ffrr)
0098 & / (dd00 + ddrr)
0099
0100
0101 dfds(+0) =
0102 & 0.5 _d 0 * (ferr - fell)
0103
0104
0105 scal = min(abs(dfds(-1)),
0106 & abs(dfds(+1)))
0107 & / max(abs(dfds(+0)), epsil)
0108
0109 scal = min(scal, 1.0 _d 0)
0110
0111 dfds(+0) = scal * dfds(+0)
0112
0113 else
0114
0115
0116 dfds(+0) = 0.0 _d 0
0117
0118 end if
0119
0120
0121 dfds(-1) = dfds(-1) / (ddll + dd00) * dd00
0122 dfds(+1) = dfds(+1) / (dd00 + ddrr) * dd00
0123
0124 return
0125
0126
0127 end