-
Notifications
You must be signed in to change notification settings - Fork 6
/
Initial_rot.f90
161 lines (157 loc) · 4.31 KB
/
Initial_rot.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
module initial_rot
!====================================================================
! This is the initial module for the PIP code.
! Module for a personal library of your initial conditions
! First version - 2013/04/26 NN
! Second version - 2013/07/17 NN Move shocktube setting to shock_tube.f90
!====================================================================
use model_rot,only:get_parameters,allocate_vars,set_dsc
use globalvar,only:ix,jx,kx,time,dt,flag_stop,&
flag_mpi,cno,neighbor,nt,x,y,z,dx,dy,dz,gra,&
flag_restart,flag_ini,dsc,dxc,dyc,dzc,nout,U_m,U_h,tend,my_rank,start_t
use mpi_rot,only:set_mpi,set_mpi_neighbor,my_mpi_barrier
use IO_rot,only:restart,output
use solver_rot,only:set_coefficients
use boundary_rot,only:initialize_bnd,PIPbnd
use Scheme_rot,only:cfl
implicit none
contains
!============================================================================
!start main part of initial setting
!============================================================================
subroutine prologue
integer i
time=0.d0
nt=0
dt=0.d0
flag_stop=0
!get parameters from setting file
call get_parameters
if(flag_mpi.eq.1)then
call set_mpi
else
write(cno,"(i4.4)")0
neighbor(:)=-1
endif
!allocate variables array
call allocate_vars
!set initial coordinates and physical variables
if(flag_restart.ge.0) then
call restart
call set_dsc
start_t=time
if (my_rank.eq.0) print *, start_t,time
else
select case(flag_ini)
case('linear_wave')
call linear_wave
case('shock_tube')
call shock_tube
case('explosion')
call explosion
case('currentsheet')
call currentsheet
case('RT')
call RT
case('KH')
call KH
case('Orszag_Tang')
call Orszag_Tang
case('FieldLoop')
call FieldLoop
case('ambipolar')
call ambipolar
case('PNcoupling')
call PNcoupling
case('HCtest')
call HCtest
case('HC_tests')
call HC_tests
case('HCtest_Tonly')
call HCtest_Tonly
case('Flare')
call Flare
case('Coalescence')
call Coalescence
case('Sedov')
call Sedov
case('tearing')
call tearing
case('NUwave')
call NUwave
case('Reconnection')
call Reconnection
case('BMP_density')
call BMP_density
case('Alfven_damping')
call Alfven_damping
case('blob')
call blob
case('field_diffusion')
call field_diffusion
case('CS_collapse')
call CS_collapse
case('asym_currentsheet')
call asym_currentsheet
case('CSC')
call CSC
case('cnd_tube')
call cnd_tube
case('MRI')
call MRI
case('disk_flare')
call disk_flare
case('load_prom')
call mass_load_prom
case('relax_prom')
call relax_prom
case('relax_prom2')
call relax_prom2
case('hsstatic')
call hsstatic
case('resonator')
call resonator
case('ionrectest')
call ionrectest
case('shock_tube_ion')
call shock_tube_ion
case('shock_tube_stab')
call shock_tube_stab
case('shock_tube_stab2')
call shock_tube_stab2
case('shock_tube_stab3')
call shock_tube_stab3
case('com_spec')
call Complete_spectrum
case('kink_wave')
call kink_wave
case('kink_instability')
call kink_instability
case('RMI')
call RMI
case('jetcrosssection')
call jetcrosssection
end select
call set_coefficients(U_h,U_m,0)
start_t=0.d0
endif
!initialize boundary
call initialize_bnd
if(flag_mpi.eq.1) call set_mpi_neighbor
dsc(1:ix,1)=dxc
dsc(1:jx,2)=dyc
dsc(1:kx,3)=dzc
call my_mpi_barrier
!set dt
call cfl(U_h,U_m)
if(flag_restart.lt.0) then
nout=0
!first output
call output(0)
endif
! start_time=0.d0
!Boundary conditions to IC
call PIPbnd(U_h,U_m,0)
! if(flag_grav.eq.1) call bnd_grav
end subroutine prologue
end module initial_rot