File indexing completed on 2018-03-02 18:41:04 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 SUBROUTINE GAD_PPM_HAT_X(bi,bj,kk,iy,
0004 & method,mask,fbar,edge,
0005 & ohat,fhat,myThid)
0006
0007
0008
0009
0010 implicit none
0011
0012
0013 # include "SIZE.h"
0014 # include "GRID.h"
0015 # include "GAD.h"
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032 integer bi,bj,kk,iy
0033 integer method
0034 _RL mask(1-OLx:sNx+OLx)
0035 _RL fbar(1-OLx:sNx+OLx)
0036 _RL edge(1-OLx:sNx+OLx)
0037 _RL ohat(1:2,
0038 & 1-OLx:sNx+OLx)
0039 _RL fhat(1:3,
0040 & 1-OLx:sNx+OLx)
0041 integer myThid
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054 integer ii,ix
0055 _RL ff00,ffll,ffrr
0056 _RL fell,ferr
0057 _RL dfds(-1:+1)
0058 _RL uhat(+1:+3)
0059 _RL lhat(+1:+3)
0060 _RL scal(+1:+2)
0061 _RL fmag,fdel
0062 integer mono
0063
0064 do ix = 1-OLx+2, sNx+OLx-2
0065
0066
0067 ff00 = fbar(ix+0)
0068 ffll = ff00
0069 & + mask(ix-1)*(fbar(ix-1)-ff00)
0070 ffrr = ff00
0071 & + mask(ix+1)*(fbar(ix+1)-ff00)
0072
0073 fell = edge(ix-0)
0074 ferr = edge(ix+1)
0075
0076
0077
0078 if ( method.eq.ENUM_PPM_NULL_LIMIT ) then
0079
0080 CALL GAD_PPM_FUN_NULL ( ff00,fell,ferr,
0081 & lhat,mono)
0082
0083
0084 elseif ( method.eq.ENUM_PPM_MONO_LIMIT ) then
0085
0086 CALL GAD_PLM_FUN_U(ffll,ff00,ffrr,dfds)
0087
0088 CALL GAD_PPM_FUN_MONO ( ff00,ffll,ffrr,
0089 & fell,ferr,dfds,lhat,mono)
0090
0091
0092 elseif ( method.eq.ENUM_PPM_WENO_LIMIT ) then
0093
0094 CALL GAD_PLM_FUN_U(ffll,ff00,ffrr,dfds)
0095
0096 CALL GAD_PPM_FUN_NULL ( ff00,fell,ferr,
0097 & uhat,mono)
0098
0099 CALL GAD_PPM_FUN_MONO ( ff00,ffll,ffrr,
0100 & fell,ferr,dfds,lhat,mono)
0101
0102 if ( mono .gt. 0) then
0103
0104
0105 fdel = abs(ffrr-ff00)+abs(ff00-ffll)
0106 fmag = abs(ffll)+abs(ff00)+abs(ffrr)
0107
0108 if (fdel .gt. 1. _d -6 * fmag) then
0109
0110
0111 CALL GAD_OSC_MUL_X(ix,+2,mask,
0112 & ohat,scal)
0113
0114 do ii = +1, +3
0115
0116 lhat(ii) = scal(1) * uhat(ii)
0117 & + scal(2) * lhat(ii)
0118 end do
0119
0120 end if
0121
0122 end if
0123
0124
0125 endif
0126
0127 do ii = +1, +3
0128
0129 fhat(ii,ix) = lhat(ii)
0130 end do
0131
0132 end do
0133
0134 return
0135
0136
0137 end