-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInterfaces.f90
436 lines (390 loc) · 12.3 KB
/
Interfaces.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
!$Id: Interfaces.f90,v 1.3 2007-08-13 09:56:44 bgiacoma Exp $
!!$ Copyright (C) 2005 B. Giacomazzo, L. Rezzolla
MODULE type
INTEGER, PARAMETER :: I4B = SELECTED_INT_KIND(9)
INTEGER, PARAMETER :: DP = KIND(1.0D0)
INTEGER, PARAMETER :: DPC = KIND(1.0D0)!,1.0D0)
INTEGER, PARAMETER :: LGT = KIND(.true.)
END MODULE type
module eos_param
implicit none
logical::eos_ideal, eos_meliani
end module eos_param
module global
use type
implicit none
real(DP)::Bx,gamma
logical::degen,verbose,veryverbose
integer(I4B)::niter,initial_data
end module global
module accmod
use type
implicit none
real(DP):: accuracy
end module accmod
module odeswitch
use type
implicit none
character(len=2)::switch
end module odeswitch
module wavecheck
use type
implicit none
logical::wave_error,shock
!real(DP)::rarefaction_pmin
end module wavecheck
module output_grid
use type
implicit none
real(DP)::x1,x2,t
integer(I4B)::nx
end module output_grid
module alfven_wave
use type
implicit none
character(len=1)::alfvenwave
real(DP),dimension(5)::leftalfven,rightalfven
end module alfven_wave
module interfaces
interface
subroutine initialdata(init,left,right)
use type
implicit none
integer(I4B),intent(IN)::init
real(DP),dimension(7),intent(OUT)::left,right
end subroutine initialdata
end interface
interface
subroutine postshock(Vs,Byb,Bzb,vxb,ahead,behind)
use type
implicit none
real(DP),intent(IN)::Vs,Byb,Bzb,vxb
real(DP),intent(IN),dimension(7)::ahead
real(DP),intent(OUT),dimension(7)::behind
end subroutine postshock
end interface
interface
subroutine velocity(unk1,unk2,ahead,switchLR,vxb,Vs,switchPB,behind)
use type
implicit none
real(DP),intent(IN)::unk1,unk2
real(DP),dimension(7),intent(IN)::ahead
character(len=2),intent(IN)::switchLR
real(DP),intent(OUT)::vxb,Vs
character(len=1),intent(IN)::switchPB
real(DP),dimension(7),intent(OUT),OPTIONAL::behind
end subroutine velocity
end interface
interface
subroutine velocity_df(unk1,unk2,ahead,vx,switchLR,f,df,Vs)
use type
implicit none
real(DP),intent(IN)::unk1,unk2,vx
real(DP),dimension(7),intent(IN)::ahead
character(len=2),intent(IN)::switchLR
real(DP),intent(OUT)::f,df
real(DP),intent(OUT),OPTIONAL::Vs
end subroutine velocity_df
end interface
interface
subroutine velocity_eqn(unk1,unk2,ahead,vx,switchLR,f,Vs,stateb)
use type
implicit none
real(DP),intent(IN)::unk1,unk2
real(DP),dimension(7),intent(IN)::ahead
real(DP),intent(IN)::vx
character(len=2),intent(IN)::switchLR
real(DP),intent(OUT)::f
real(DP),intent(OUT)::Vs
real(DP),dimension(7),OPTIONAL,intent(OUT)::stateb
end subroutine velocity_eqn
end interface
interface
subroutine ContactVelocity(unk1,unk2,vxb,Vs,ahead,vx,switchLR,switchPB,solution)
use type
implicit none
real(DP),intent(IN)::unk1,unk2,vxb
real(DP),intent(OUT)::Vs
real(DP),dimension(7),intent(IN)::ahead
real(DP),intent(OUT)::vx
character(len=2),intent(IN)::switchLR
character(len=1),intent(IN)::switchPB
real(DP),dimension(7),intent(OUT),OPTIONAL::solution
end subroutine ContactVelocity
end interface
interface
subroutine shockfunc(Vs,unk1,unk2,pb,ahead,f,switchLR,switchPB,errcheck)
USE type
IMPLICIT NONE
REAL(DP),INTENT(IN) :: Vs,unk1,unk2,pb
real(DP),dimension(7),intent(IN) ::ahead
REAL(DP),intent(OUT):: f
character(len=2),intent(IN)::switchLR
character(len=1),intent(IN)::switchPB
logical,intent(OUT)::errcheck
end subroutine shockfunc
end interface
interface
SUBROUTINE zeroeqn(vxb,unk1,unk2,Vs,ahead,f,df,switchLR,switchPB,errcheck)
USE type
IMPLICIT NONE
REAL(DP),INTENT(IN) :: vxb,unk1,unk2,Vs
real(DP),dimension(7),intent(IN)::ahead
REAL(DP),INTENT(OUT) :: f
REAL(DP),INTENT(OUT) :: df
character(len=2),intent(IN)::switchLR
character(len=1),intent(IN)::switchPB
logical,intent(OUT)::errcheck
end SUBROUTINE zeroeqn
end interface
interface
subroutine contact(left,right,pb,VsL,VsR,solution,degen_case)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),intent(OUT)::pb
real(DP),intent(OUT)::VsL,VsR
real(DP),dimension(7,2),intent(OUT)::solution
integer(I4B),intent(IN)::degen_case
end subroutine contact
end interface
interface
subroutine fullcontact(left,right,unk,VsLv3,VsRv3,fullsolution)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),dimension(4),intent(INOUT)::unk
real(DP),dimension(3),intent(OUT)::VsLv3,VsRv3
real(DP),dimension(7,6),intent(OUT)::fullsolution
end subroutine fullcontact
end interface
interface
subroutine funcv(left,right,pb,VsL,VsR,f,left_wave,right_wave,solution)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),intent(IN)::pb
real(DP),intent(OUT)::VsL,VsR
real(DP),intent(OUT)::f
character(len=2),intent(IN)::left_wave,right_wave
real(DP),dimension(7,2),intent(OUT),OPTIONAL::solution
end subroutine funcv
end interface
interface
subroutine funcd(left,right,pb,VsL,VsR,f,df,left_wave,right_wave)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),intent(IN)::pb
real(DP),intent(OUT)::VsL,VsR
real(DP),intent(OUT)::f,df
character(len=2),intent(IN)::left_wave,right_wave
end subroutine funcd
end interface
interface
subroutine fullfuncd(left,right,unk,VsLv3,VsRv3,fvec,fjac,fullsolution)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),dimension(4),intent(IN)::unk
real(DP),dimension(3),intent(OUT)::VsLv3,VsRv3
real(DP),dimension(4),intent(OUT)::fvec
real(DP),dimension(4,4),intent(OUT)::fjac
real(DP),dimension(7,6),intent(OUT),OPTIONAL::fullsolution
end subroutine fullfuncd
end interface
interface
subroutine fullfuncv(left,right,unk,VsLv3,VsRv3,fvec,fullsolution)
use type
implicit none
real(DP),dimension(7),intent(IN)::left,right
real(DP),dimension(4),intent(IN)::unk
real(DP),dimension(3),intent(OUT)::VsLv3,VsRv3
real(DP),dimension(4),intent(OUT)::fvec
real(DP),dimension(7,6),intent(OUT),OPTIONAL::fullsolution
end subroutine fullfuncv
end interface
interface
subroutine output(x1,x2,t,nx,left,right,VsLv3,VsRv3,unk,fullsolution)
use type
implicit none
real(DP),intent(IN)::x1,x2,t
real(DP),dimension(4),intent(IN)::unk
real(DP),dimension(3),intent(IN)::VsLv3,VsRv3
integer(I4B),intent(IN)::nx
real(DP),dimension(7),intent(IN)::left,right
real(DP),dimension(7,6),intent(IN)::fullsolution
end subroutine output
end interface
interface
subroutine Rarefaction(pb,Vs,init,solution,switchLR)
use type
implicit none
real(DP),intent(IN)::pb
real(DP),intent(OUT)::Vs
real(DP),dimension(7),intent(IN)::init
real(DP),dimension(7),intent(OUT)::solution
character(len=2),intent(IN)::switchLR
end subroutine Rarefaction
end interface
interface
subroutine RHS(x,y,f,switchLR)
use type
implicit none
real(DP),intent(IN)::x
real(DP),dimension(7),intent(IN)::y
real(DP),dimension(7),intent(OUT)::f
character(len=2),intent(IN)::switchLR
end subroutine RHS
end interface
interface
subroutine xi(state,switchLR,Vs,allwaves)
use type
implicit none
real(DP),dimension(7),intent(IN)::state
character(len=2),intent(IN)::switchLR
real(DP),intent(OUT)::Vs
real(DP),dimension(4),intent(OUT),OPTIONAL::allwaves
end subroutine xi
end interface
interface
subroutine quartic(a,rtr)
use type
implicit none
real(DP),dimension(0:4),intent(IN)::a
real(DP),dimension(4),intent(OUT)::rtr
end subroutine quartic
end interface
interface
subroutine cubic(c,W,check)
use type
implicit none
real(DP),dimension(0:2),intent(IN)::c
real(DP),dimension(1:3),intent(OUT)::W
logical(LGT),intent(OUT),optional::check
end subroutine cubic
end interface
interface
subroutine shockvelocity(ahead,normB,wavetype,W)
use type
implicit none
real(DP),dimension(7),intent(IN)::ahead
real(DP),intent(IN)::normB
character(len=2),intent(IN)::wavetype
real(DP),intent(OUT)::W
end subroutine shockvelocity
end interface
interface
subroutine postshock_pressure(Vs,pb,ahead,behind,alfcheck)
use type
implicit none
real(DP),intent(IN)::Vs,pb
real(DP),intent(IN),dimension(7)::ahead !value of primitives ahead the shock
real(DP),intent(OUT),dimension(7)::behind
logical,intent(IN),OPTIONAL::alfcheck
end subroutine postshock_pressure
end interface
interface
subroutine Rarefaction_pressure(pb,Vs,init,solution,switchLR)
use type
implicit none
real(DP),intent(IN)::pb
real(DP),intent(OUT)::Vs
real(DP),dimension(7),intent(IN)::init
real(DP),dimension(7),intent(OUT)::solution
character(len=2),intent(IN)::switchLR
end subroutine Rarefaction_pressure
end interface
interface
subroutine RHS_pressure(x,y,f,switchLR)
use type
implicit none
real(DP),intent(IN)::x
real(DP),dimension(7),intent(IN)::y
real(DP),dimension(7),intent(OUT)::f
character(len=2),intent(IN)::switchLR
end subroutine RHS_pressure
end interface
interface
subroutine alfven(Vs,ahead,behind)
use type
implicit none
real(DP),intent(IN)::Vs
real(DP),dimension(7),intent(IN)::ahead
real(DP),dimension(7),intent(INOUT)::behind
end subroutine alfven
end interface
interface
subroutine alfven_df(ahead,Vs,behind,f,df)
use type
implicit none
real(DP),intent(IN)::Vs
real(DP),intent(IN),dimension(7)::ahead,behind
real(DP),intent(OUT),dimension(5)::f
real(DP),intent(OUT),dimension(5,5)::df
end subroutine alfven_df
end interface
interface
subroutine alfven_func(ahead,Vs,behind,f)
use type
implicit none
real(DP),intent(IN)::Vs
real(DP),dimension(7),intent(IN)::ahead,behind
real(DP),intent(OUT),dimension(5)::f
end subroutine alfven_func
end interface
interface
subroutine Rarefaction_psi(normB,Vs,init,solution,switchLR)
use type
implicit none
real(DP),intent(IN)::normB
real(DP),intent(OUT)::Vs
real(DP),dimension(7),intent(IN)::init
real(DP),dimension(7),intent(OUT)::solution
character(len=2),intent(IN)::switchLR
end subroutine Rarefaction_psi
end interface
interface
subroutine RHS_psi(x,y,f,switchLR)
use type
implicit none
real(DP),intent(IN)::x
real(DP),dimension(7),intent(IN)::y
real(DP),dimension(7),intent(OUT)::f
character(len=2),intent(IN)::switchLR
end subroutine RHS_psi
end interface
interface
subroutine eos_enthalpy(pgas,rho,gamma,enthalpy)
use type
implicit none
real(DP), intent(IN)::pgas,rho,gamma
real(DP), intent(OUT)::enthalpy
end subroutine eos_enthalpy
end interface
interface
subroutine eos_cs2(pgas,rho,gamma,cs2)
use type
implicit none
real(DP), intent(IN)::pgas,rho,gamma
real(DP), intent(OUT)::cs2
end subroutine eos_cs2
end interface
!interfaces to NR routines
INTERFACE
SUBROUTINE lubksb(a,indx,b)
USE type
REAL(DP), DIMENSION(:,:), INTENT(IN) :: a
INTEGER(I4B), DIMENSION(:), INTENT(IN) :: indx
REAL(DP), DIMENSION(:), INTENT(INOUT) :: b
END SUBROUTINE lubksb
END INTERFACE
INTERFACE
SUBROUTINE ludcmp(a,indx,d)
USE type
REAL(DP), DIMENSION(:,:), INTENT(INOUT) :: a
INTEGER(I4B), DIMENSION(:), INTENT(OUT) :: indx
REAL(DP), INTENT(OUT) :: d
END SUBROUTINE ludcmp
END INTERFACE
end module interfaces