File indexing completed on 2018-11-23 06:10:12 UTC
view on githubraw file Latest commit 83ddf5a6 on 2018-11-23 00:26:56 UTC
8e4c181d69 Jean*0001 # include "GAD_OPTIONS.h"
0002
0003 SUBROUTINE GAD_PPM_FLX_X(bi,bj,kk,iy,
0004 & calc_CFL,delT,uvel,
0005 & ufac,fhat,flux,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 integer bi,bj,kk,iy
0030 logical calc_CFL
0031 _RL delT
0032 _RL uvel(1-OLx:sNx+OLx,
0033 & 1-OLy:sNy+OLy)
0034 _RL ufac(1-OLx:sNx+OLx,
0035 & 1-OLy:sNy+OLy)
0036 _RL fhat(1:3,
0037 & 1-OLx:sNx+OLx)
0038 _RL flux(1-OLx:sNx+OLx,
0039 & 1-OLy:sNy+OLy)
0040 integer myThid
0041
0042
0043
0044
0045
0046
0047
0048
0049 integer ix
0050 _RL uCFL,intF
0051 _RL ss11,ss22
0052 _RL ivec(1:3)
0053
0054
0055
0056
0057
0058
0059
0060
0061
0062
0063 do ix = 1-OLx+3, sNx+OLx-2
0064
0065 if (uvel(ix,iy) .eq. 0. _d 0) then
0066
0067 flux(ix,iy) = 0. _d 0
0068
0069 else
0070
0071 if (uvel(ix,iy) .gt. 0. _d 0) then
0072
0073
0074 if ( calc_CFL ) then
0075 uCFL = uvel(ix,iy) * delT
0076 & * recip_dxF(ix-1,iy,bi,bj)
0077 & * recip_deepFacC(kk)
0078 else
0079 uCFL = uvel(ix,iy)
0080 end if
0081
0082 ss11 = +1. _d 0 - 2. _d 0 * uCFL
0083 ss22 = +1. _d 0
0084
0085
0086 ivec(1) = ss22 - ss11
0087 ivec(2) =(ss22 ** 2
0088 & - ss11 ** 2)*(1. _d 0 / 2. _d 0)
0089 ivec(3) =(ss22 ** 3
0090 & - ss11 ** 3)*(1. _d 0 / 3. _d 0)
0091
0092 intF = ivec(1) * fhat(1,ix-1)
0093 & + ivec(2) * fhat(2,ix-1)
0094 & + ivec(3) * fhat(3,ix-1)
0095
83ddf5a6c6 Mart*0096
8e4c181d69 Jean*0097
0098 else
0099
0100
0101 if ( calc_CFL ) then
0102 uCFL = uvel(ix,iy) * delT
0103 & * recip_dxF(ix-0,iy,bi,bj)
0104 & * recip_deepFacC(kk)
0105 else
0106 uCFL = uvel(ix,iy)
0107 end if
0108
0109 ss11 = -1. _d 0 - 2. _d 0 * uCFL
0110 ss22 = -1. _d 0
0111
0112
0113 ivec(1) = ss22 - ss11
0114 ivec(2) =(ss22 ** 2
0115 & - ss11 ** 2)*(1. _d 0 / 2. _d 0)
0116 ivec(3) =(ss22 ** 3
0117 & - ss11 ** 3)*(1. _d 0 / 3. _d 0)
0118
0119 intF = ivec(1) * fhat(1,ix-0)
0120 & + ivec(2) * fhat(2,ix-0)
0121 & + ivec(3) * fhat(3,ix-0)
0122
83ddf5a6c6 Mart*0123
8e4c181d69 Jean*0124
0125 end if
0126
83ddf5a6c6 Mart*0127
0128
0129 intF = 0.5 _d 0 * intF / sign(max(abs(uCFL),1.d-20),uCFL)
0130
8e4c181d69 Jean*0131
0132 flux(ix,iy) = + ufac(ix,iy) * intF
0133
0134 end if
0135
0136 end do
0137
0138 return
0139
0140
0141 end