97 REAL,
PARAMETER :: gn = 1.0
98 INTEGER,
PARAMETER :: units = geometrical
100 REAL,
PARAMETER ::
omega = 1.0
101 REAL,
PARAMETER :: sigma0 = 1.0
102 REAL,
PARAMETER :: tsim = 100./
omega 103 REAL,
PARAMETER :: gamma = 2.0
104 REAL,
PARAMETER :: beta_c = 10.0
106 REAL,
PARAMETER :: q = 1.5
108 INTEGER,
PARAMETER :: mgeo = cartesian
109 INTEGER,
PARAMETER :: shear_direction = 1
110 INTEGER,
PARAMETER :: xres = 1024
111 INTEGER,
PARAMETER :: yres = 1024
112 INTEGER,
PARAMETER :: zres = 1
113 REAL :: domainx = 320.0
114 REAL :: domainy = 320.0
116 INTEGER,
PARAMETER :: onum = 100
118 CHARACTER(LEN=256),
PARAMETER :: odir =
"./" 119 CHARACTER(LEN=256),
PARAMETER :: ofname =
"shearingsheet" 121 CLASS(
fosite),
ALLOCATABLE :: sim
127 CALL asl_library_initialize()
130 CALL sim%InitFosite()
133 CALL initdata(sim%Mesh, sim%Physics, sim%Timedisc%pvar, sim%Timedisc%cvar)
139 CALL asl_library_finalize()
149 TYPE(Dict_TYP),
POINTER :: config
152 TYPE(Dict_TYP),
POINTER :: mesh,physics,fluxes,grav,cooling, &
153 shearingbox,sources,timedisc,datafile
154 REAL :: XMIN,XMAX,YMIN,YMAX,ZMIN,ZMAX, SOUNDSPEED
164 soundspeed = pi*gn*sigma0/
omega 170 "units" / geometrical &
175 "meshtype" / midpoint, &
178 "shear_dir" / shear_direction, &
179 "decomposition" / (/ 1, -1, 1/), &
196 "variables" / primitive, &
197 "limiter" / vanleer &
203 "self/gtype" / sboxspectral, &
204 "self/output/phi" / 0, &
205 "self/output/accel_x" / 0, &
206 "self/output/Fmass2D" / 0, &
207 "self/output/accel_y" / 0 &
212 "stype" / disk_cooling, &
213 "method" / gammie_sb, &
214 "output/Qcool" / 1, &
219 shearingbox => dict(&
225 "cooling" / cooling, &
226 "shearing" / shearingbox, &
232 "method" / dormand_prince, &
236 "output/external_sources" / 0, &
237 "output/density_cvar" / 0, &
238 "output/energy" / 0, &
239 "output/xmomentum" / 0, &
240 "output/ymomentum" / 0, &
242 "output/geometrical_sources" / 0, &
243 "maxiter" / 100000000, &
249 "fileformat" / xdmf, &
250 "filepath" / trim(odir), &
251 "filename" / trim(ofname), &
258 "physics" / physics, &
260 "sources" / sources, &
261 "timedisc" / timedisc, &
262 "datafile" / datafile &
266 SUBROUTINE initdata(Mesh,Physics, pvar, cvar)
269 CLASS(mesh_base),
INTENT(IN) :: Mesh
270 CLASS(physics_base),
INTENT(IN) :: Physics
271 CLASS(marray_compound),
POINTER,
INTENT(INOUT) :: pvar,cvar
274 REAL,
DIMENSION(Mesh%IGMIN:Mesh%IGMAX,Mesh%JGMIN:Mesh%JGMAX,Mesh%KGMIN:Mesh%KGMAX) &
280 SELECT TYPE(p => pvar)
281 TYPE IS(statevector_euler)
283 p%density%data3d(:,:,:) = sigma0
286 soundspeed = pi*physics%Constants%GN*sigma0/
omega 287 p%pressure%data3d(:,:,:) = 2.5**2*pi*pi* &
288 physics%Constants%GN**2.*sigma0**3./(gamma*
omega**2)
294 CALL asl_random_create(rng, asl_randommethod_mt19937_64)
295 CALL asl_random_distribute_uniform(rng)
296 n = (mesh%IGMAX-mesh%IGMIN+1)*(mesh%JGMAX-mesh%JGMIN+1)*(mesh%KGMAX-mesh%KGMIN+1)
298 IF (mesh%shear_dir.EQ.2)
THEN 300 CALL random_number(rands)
302 CALL asl_random_generate_d(rng, n, rands)
304 rands = (rands-0.5)*0.1*soundspeed
305 p%velocity%data4d(:,:,:,1) = rands(:,:,:)
308 CALL random_number(rands)
310 CALL asl_random_generate_d(rng, n, rands)
312 rands = (rands-0.5)*0.1*soundspeed
313 p%velocity%data4d(:,:,:,2) = -q*
omega*mesh%bcenter(:,:,:,1) + rands(:,:,:)
314 ELSE IF (mesh%shear_dir.EQ.1)
THEN 316 CALL random_number(rands)
318 CALL asl_random_generate_d(rng, n, rands)
320 rands = (rands-0.5)*0.1*soundspeed
321 p%velocity%data4d(:,:,:,1) = q*
omega*mesh%bcenter(:,:,:,2) + rands(:,:,:)
324 CALL random_number(rands)
326 CALL asl_random_generate_d(rng, n, rands)
328 rands = (rands-0.5)*0.1*soundspeed
329 p%velocity%data4d(:,:,:,2) = rands(:,:,:)
332 CALL physics%Error(
"shear::InitData",
"only non-isothermal HD supported")
335 CALL asl_random_destroy(rng)
338 CALL physics%Convert2Conservative(pvar,cvar)
339 CALL mesh%Info(
" DATA-----> initial condition: " // &
340 "Standard run shearingsheet")
347 CLASS(physics_base),
INTENT(IN) :: Physics
348 INTEGER :: i, n, clock
349 INTEGER,
DIMENSION(:),
ALLOCATABLE :: seed
353 CALL random_seed(
size = n)
355 CALL system_clock(count=clock)
356 seed = clock + 37 * (/ (i - 1, i = 1, n) /)
358 seed = seed + physics%GetRank()
360 CALL random_seed(put = seed)
pure real function, dimension(size(ephir%data2d, dim=1)) omega(ephir, velocity)
subroutine initdata(Mesh, Physics, Fluxes, Timedisc)
subroutine makeconfig(Sim, config)
subroutine initrandseed(Physics)