1 c **************************************************
2 c Here are macros that define
the:
4 c **************************************************
6 c ======================================================================
8 c tba = length of slow start interval (<0 mean no slow start)
9 c ======================================================================
12 c tba=max(REAL_EPSILON,tb-
ta);
16 #defineMacro ramp3(t,tba) (t)*(t)*( -(t)/3.+.5*tba )*6./(tba*tba*tba)
17 #defineMacro ramp3t(t,tba) (t)*( -(t) + tba )*6./(tba*tba*tba)
18 #defineMacro ramp3tt(t,tba) ( -2.*(t) + tba )*6./(tba*tba*tba)
19 #defineMacro ramp3ttt(t,tba) ( -2. )*6./(tba*tba*tba)
21 c This ramp has 3-derivatives zero at t=0 and t=1
22 c This is from ramp.maple
23 c r=-84*t**5+35*t**4-20*t**7+70*t**6
24 c rt=-420*t**4+140*t**3-140*t**6+420*t**5
25 c rtt=-1680*t**3+420*t**2-840*t**5+2100*t**4
26 c rttt=-5040*t**2+840*t-4200*t**4+8400*t**3
28 #defineMacro ramp(t) ( -84*(t)**5+35*(t)**4-20*(t)**7+70*(t)**6 )
29 #defineMacro rampt(t) ( -420*(t)**4+140*(t)**3-140*(t)**6+420*(t)**5 )
30 #defineMacro ramptt(t) ( -1680*(t)**3+420*(t)**2-840*(t)**5+2100*(t)**4 )
31 #defineMacro rampttt(t) ( -5040*(t)**2+840*(t)-4200*(t)**4+8400*(t)**3 )
33 c This ramp has 4-derivatives zero at t=0 and t=1
34 c This is from ramp.maple
35 c r=126*(t)**5-315*(t)**8+70*(t)**9-420*(t)**6+540*(t)**7
36 c rt=630*(t)**4-2520*(t)**7+630*(t)**8-2520*(t)**5+3780*(t)**6
37 c rtt=2520*(t)**3-17640*(t)**6+5040*(t)**7-12600*(t)**4+22680*(t)**5
38 c rttt=7560*(t)**2-105840*(t)**5+35280*(t)**6-50400*(t)**3+113400*(t)**4
40 #defineMacro ramp4(t) ( 126*(t)**5-315*(t)**8+70*(t)**9-420*(t)**6+540*(t)**7 )
41 #defineMacro ramp4t(t) ( 630*(t)**4-2520*(t)**7+630*(t)**8-2520*(t)**5+3780*(t)**6 )
42 #defineMacro ramp4tt(t) ( 2520*(t)**3-17640*(t)**6+5040*(t)**7-12600*(t)**4+22680*(t)**5 )
43 #defineMacro ramp4ttt(t) ( 7560*(t)**2-105840*(t)**5+35280*(t)**6-50400*(t)**3+113400*(t)**4 )
44 #defineMacro ramp4tttt(t) ( 15120*(t)-529200*(t)**4+211680*(t)**5-151200*(t)**2+453600*(t)**3 )
46 c ============================================================
47 c Initialize parameters
for the boundary forcing
48 c tba: slow start time interval -- no slow start
if this is negative
49 c ===========================================================
50 #beginMacro initializeBoundaryForcing(t,tba)
51 c write(*,
'("initializeBoundaryForcing tba=",e10.2)') tba
52 if( t.le.0 .and. tba.
gt.0. )then
64 ssftttt = ramp4tttt(tt)
74 c **************** Here is
the new generic plane wave solution *******************
77 #defineMacro planeWave0(x,y,z,t,n) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(n)
79 #defineMacro planeWavet0(x,y,z,t,n) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(n)
80 ! two time derivatives:
81 #defineMacro planeWavett0(x,y,z,t,n) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(n))
82 ! three time derivatives:
83 #defineMacro planeWave3ttt0(x,y,z,t,n) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(n))
85 c *************** Here is
the 2
D planeWave solution ******************************
87 #defineMacro planeWave2Dex0(x,y,t) sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(0)
88 #defineMacro planeWave2Dey0(x,y,t) sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(1)
89 #defineMacro planeWave2Dhz0(x,y,t) sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(5)
92 #defineMacro planeWave2Dext0(x,y,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(0)
93 #defineMacro planeWave2Deyt0(x,y,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(1)
94 #defineMacro planeWave2Dhzt0(x,y,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(5)
96 c two time derivatives:
97 #defineMacro planeWave2Dextt0(x,y,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(0))
98 #defineMacro planeWave2Deytt0(x,y,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(1))
99 #defineMacro planeWave2Dhztt0(x,y,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(5))
101 c three time derivatives:
102 #defineMacro planeWave2Dexttt0(x,y,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(0))
103 #defineMacro planeWave2Deyttt0(x,y,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(1))
104 #defineMacro planeWave2Dhzttt0(x,y,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(5))
106 c four time derivatives:
107 #defineMacro planeWave2Dextttt0(x,y,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(0))
108 #defineMacro planeWave2Deytttt0(x,y,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(1))
109 #defineMacro planeWave2Dhztttt0(x,y,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)-cc*(t)))*pwc(5))
111 c Here are
the slow start versions
112 #defineMacro planeWave2Dex(x,y,t) (ssf*planeWave2Dex0(x,y,t))
113 #defineMacro planeWave2Dey(x,y,t) (ssf*planeWave2Dey0(x,y,t))
114 #defineMacro planeWave2Dhz(x,y,t) (ssf*planeWave2Dhz0(x,y,t))
117 #defineMacro planeWave2Dext(x,y,t) (ssf*planeWave2Dext0(x,y,t)+ssft*planeWave2Dex0(x,y,t))
118 #defineMacro planeWave2Deyt(x,y,t) (ssf*planeWave2Deyt0(x,y,t)+ssft*planeWave2Dey0(x,y,t))
119 #defineMacro planeWave2Dhzt(x,y,t) (ssf*planeWave2Dhzt0(x,y,t)+ssft*planeWave2Dhz0(x,y,t))
121 c two time derivatives:
122 #defineMacro planeWave2Dextt(x,y,t) (ssf*planeWave2Dextt0(x,y,t)+2.*ssft*planeWave2Dext0(x,y,t)\
123 +ssftt*planeWave2Dex0(x,y,t))
124 #defineMacro planeWave2Deytt(x,y,t) (ssf*planeWave2Deytt0(x,y,t)+2.*ssft*planeWave2Deyt0(x,y,t)\
125 +ssftt*planeWave2Dey0(x,y,t))
126 #defineMacro planeWave2Dhztt(x,y,t) (ssf*planeWave2Dhztt0(x,y,t)+2.*ssft*planeWave2Dhzt0(x,y,t)\
127 +ssftt*planeWave2Dhz0(x,y,t))
129 c three time derivatives:
130 #defineMacro planeWave2Dexttt(x,y,t) (ssf*planeWave2Dexttt0(x,y,t)+3.*ssft*planeWave2Dextt0(x,y,t)\
131 +3.*ssftt*planeWave2Dext0(x,y,t)+ssfttt*planeWave2Dex0(x,y,t))
132 #defineMacro planeWave2Deyttt(x,y,t) (ssf*planeWave2Deyttt0(x,y,t)+3.*ssft*planeWave2Deytt0(x,y,t)\
133 +3.*ssftt*planeWave2Deyt0(x,y,t)+ssfttt*planeWave2Dey0(x,y,t))
134 #defineMacro planeWave2Dhzttt(x,y,t) (ssf*planeWave2Dhzttt0(x,y,t)+3.*ssft*planeWave2Dhztt0(x,y,t)\
135 +3.*ssftt*planeWave2Dhzt0(x,y,t)+ssfttt*planeWave2Dhz0(x,y,t))
137 c four time derivatives:
138 #defineMacro planeWave2Dextttt(x,y,t) (ssf*planeWave2Dextttt0(x,y,t)+4.*ssft*planeWave2Dexttt0(x,y,t)\
139 +6.*ssftt*planeWave2Dextt0(x,y,t)+4.*ssfttt*planeWave2Dext0(x,y,t)+ssftttt*planeWave2Dex0(x,y,t))
140 #defineMacro planeWave2Deytttt(x,y,t) (ssf*planeWave2Deytttt0(x,y,t)+4.*ssft*planeWave2Deyttt0(x,y,t)\
141 +6.*ssftt*planeWave2Deytt0(x,y,t)+4.*ssfttt*planeWave2Deyt0(x,y,t)+ssftttt*planeWave2Dey0(x,y,t))
142 #defineMacro planeWave2Dhztttt(x,y,t) (ssf*planeWave2Dhztttt0(x,y,t)+4.*ssft*planeWave2Dhzttt0(x,y,t)\
143 +6.*ssftt*planeWave2Dhztt0(x,y,t)+4.*ssfttt*planeWave2Dhzt0(x,y,t)+ssftttt*planeWave2Dhz0(x,y,t))
146 c **************** Here is
the 3
D planeWave solution ***************************************
148 #defineMacro planeWave3Dex0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(0)
149 #defineMacro planeWave3Dey0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(1)
150 #defineMacro planeWave3Dez0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(2)
152 #defineMacro planeWave3Dhx0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(3)
153 #defineMacro planeWave3Dhy0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(4)
154 #defineMacro planeWave3Dhz0(x,y,z,t) sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(5)
157 #defineMacro planeWave3Dext0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(0)
158 #defineMacro planeWave3Deyt0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(1)
159 #defineMacro planeWave3Dezt0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(2)
161 #defineMacro planeWave3Dhxt0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(3)
162 #defineMacro planeWave3Dhyt0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(4)
163 #defineMacro planeWave3Dhzt0(x,y,z,t) (-twoPi*cc)*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(5)
165 c two time derivatives:
166 #defineMacro planeWave3Dextt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(0))
167 #defineMacro planeWave3Deytt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(1))
168 #defineMacro planeWave3Deztt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(2))
170 #defineMacro planeWave3Dhxtt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(3))
171 #defineMacro planeWave3Dhytt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(4))
172 #defineMacro planeWave3Dhztt0(x,y,z,t) (-(twoPi*cc)**2*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(5))
174 c three time derivatives:
175 #defineMacro planeWave3Dexttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(0))
176 #defineMacro planeWave3Deyttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(1))
177 #defineMacro planeWave3Dezttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(2))
179 #defineMacro planeWave3Dhxttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(3))
180 #defineMacro planeWave3Dhyttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(4))
181 #defineMacro planeWave3Dhzttt0(x,y,z,t) ((twoPi*cc)**3*cos(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(5))
183 c four time derivatives:
184 #defineMacro planeWave3Dextttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(0))
185 #defineMacro planeWave3Deytttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(1))
186 #defineMacro planeWave3Deztttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(2))
188 #defineMacro planeWave3Dhxtttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(3))
189 #defineMacro planeWave3Dhytttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(4))
190 #defineMacro planeWave3Dhztttt0(x,y,z,t) ((twoPi*cc)**4*sin(twoPi*(kx*(x)+ky*(y)+kz*(z)-cc*(t)))*pwc(5))
192 c Here are
the slow start versions
193 #defineMacro planeWave3Dex(x,y,z,t) (ssf*planeWave3Dex0(x,y,z,t))
194 #defineMacro planeWave3Dey(x,y,z,t) (ssf*planeWave3Dey0(x,y,z,t))
195 #defineMacro planeWave3Dez(x,y,z,t) (ssf*planeWave3Dez0(x,y,z,t))
197 #defineMacro planeWave3Dhx(x,y,z,t) (ssf*planeWave3Dhx0(x,y,z,t))
198 #defineMacro planeWave3Dhy(x,y,z,t) (ssf*planeWave3Dhy0(x,y,z,t))
199 #defineMacro planeWave3Dhz(x,y,z,t) (ssf*planeWave3Dhz0(x,y,z,t))
202 #defineMacro planeWave3Dext(x,y,z,t) (ssf*planeWave3Dext0(x,y,z,t)+ssft*planeWave3Dex0(x,y,z,t))
203 #defineMacro planeWave3Deyt(x,y,z,t) (ssf*planeWave3Deyt0(x,y,z,t)+ssft*planeWave3Dey0(x,y,z,t))
204 #defineMacro planeWave3Dezt(x,y,z,t) (ssf*planeWave3Dezt0(x,y,z,t)+ssft*planeWave3Dez0(x,y,z,t))
206 #defineMacro planeWave3Dhxt(x,y,z,t) (ssf*planeWave3Dext0(x,y,z,t)+ssft*planeWave3Dhx0(x,y,z,t))
207 #defineMacro planeWave3Dhyt(x,y,z,t) (ssf*planeWave3Deyt0(x,y,z,t)+ssft*planeWave3Dhy0(x,y,z,t))
208 #defineMacro planeWave3Dhzt(x,y,z,t) (ssf*planeWave3Dezt0(x,y,z,t)+ssft*planeWave3Dhz0(x,y,z,t))
210 c two time derivatives:
211 #defineMacro planeWave3Dextt(x,y,z,t) (ssf*planeWave3Dextt0(x,y,z,t)+2.*ssft*planeWave3Dext0(x,y,z,t)\
212 +ssftt*planeWave3Dex0(x,y,z,t))
213 #defineMacro planeWave3Deytt(x,y,z,t) (ssf*planeWave3Deytt0(x,y,z,t)+2.*ssft*planeWave3Deyt0(x,y,z,t)\
214 +ssftt*planeWave3Dey0(x,y,z,t))
215 #defineMacro planeWave3Deztt(x,y,z,t) (ssf*planeWave3Deztt0(x,y,z,t)+2.*ssft*planeWave3Dezt0(x,y,z,t)\
216 +ssftt*planeWave3Dez0(x,y,z,t))
218 c three time derivatives:
219 #defineMacro planeWave3Dexttt(x,y,z,t) (ssf*planeWave3Dexttt0(x,y,z,t)+3.*ssft*planeWave3Dextt0(x,y,z,t)\
220 +3.*ssftt*planeWave3Dext0(x,y,z,t)+ssfttt*planeWave3Dex0(x,y,z,t))
221 #defineMacro planeWave3Deyttt(x,y,z,t) (ssf*planeWave3Deyttt0(x,y,z,t)+3.*ssft*planeWave3Deytt0(x,y,z,t)\
222 +3.*ssftt*planeWave3Deyt0(x,y,z,t)+ssfttt*planeWave3Dey0(x,y,z,t))
223 #defineMacro planeWave3Dezttt(x,y,z,t) (ssf*planeWave3Dezttt0(x,y,z,t)+3.*ssft*planeWave3Deztt0(x,y,z,t)\
224 +3.*ssftt*planeWave3Dezt0(x,y,z,t)+ssfttt*planeWave3Dez0(x,y,z,t))
226 c four time derivatives:
227 #defineMacro planeWave3Dextttt(x,y,z,t) (ssf*planeWave3Dextttt0(x,y,z,t)+4.*ssft*planeWave3Dexttt0(x,y,z,t)\
228 +6.*ssftt*planeWave3Dextt0(x,y,z,t)+4.*ssfttt*planeWave3Dext0(x,y,z,t)+ssftttt*planeWave3Dex0(x,y,z,t))
229 #defineMacro planeWave3Deytttt(x,y,z,t) (ssf*planeWave3Deytttt0(x,y,z,t)+4.*ssft*planeWave3Deyttt0(x,y,z,t)\
230 +6.*ssftt*planeWave3Deytt0(x,y,z,t)+4.*ssfttt*planeWave3Deyt0(x,y,z,t)+ssftttt*planeWave3Dey0(x,y,z,t))
231 #defineMacro planeWave3Deztttt(x,y,z,t) (ssf*planeWave3Deztttt0(x,y,z,t)+4.*ssft*planeWave3Dezttt0(x,y,z,t)\
232 +6.*ssftt*planeWave3Deztt0(x,y,z,t)+4.*ssfttt*planeWave3Dezt0(x,y,z,t)+ssftttt*planeWave3Dez0(x,y,z,t))
236 #beginMacro getMinusPlaneWave3Dtt(i1,i2,i3,t,udd,vdd,wdd)
241 if( fieldOption.eq.0 )then
242 udd=-planeWave3Dextt(x00,y00,z00,t)
243 vdd=-planeWave3Deytt(x00,y00,z00,t)
244 wdd=-planeWave3Deztt(x00,y00,z00,t)
247 udd=-planeWave3Dexttt(x00,y00,z00,t)
248 vdd=-planeWave3Deyttt(x00,y00,z00,t)
249 wdd=-planeWave3Dezttt(x00,y00,z00,t)