2D AMRCLAW
ginit.f
Go to the documentation of this file.
1 c
2 c -------------------------------------------------------------
3 c
4  subroutine ginit(msave, first, nvar, naux, start_time)
5 c
6  use amr_module
7  implicit double precision (a-h,o-z)
8  logical first
9 
10 
11 c ::::::::::::::::::::::::::::: GINIT ::::::::::::::::::::::::
12 c
13 c initializes soln on all grids at 'level' by calling qinit
14 c if first = true, (first call to init), then allocate the
15 c soln storage area too, else was already allocated.
16 c
17 c :::::::::::::::::::::::::::::::::::::::;::::::::::::::::::::
18 
19  if (msave .eq. 0) go to 99
20 
21  level = node(nestlevel,msave)
22  hx = hxposs(level)
23  hy = hyposs(level)
24  mptr = msave
25 
26  10 nx = node(ndihi,mptr) - node(ndilo,mptr) + 1
27  ny = node(ndjhi,mptr) - node(ndjlo,mptr) + 1
28  mitot = nx + 2*nghost
29  mjtot = ny + 2*nghost
30  corn1 = rnode(cornxlo,mptr)
31  corn2 = rnode(cornylo,mptr)
32  if(.not. (first)) go to 20
33  loc = igetsp(mitot*mjtot*nvar)
34  node(store1,mptr) = loc
35  if (naux .gt. 0) then
36  locaux = igetsp(mitot*mjtot*naux)
37  do k = 1, mitot*mjtot*naux,naux ! set first component of aux to signal that it
38  alloc(locaux+k-1) = needs_to_be_set ! needs val, wasnt copied from other grids
39  end do
40 
41  call setaux(nghost,nx,ny,corn1,corn2,hx,hy,
42  & naux,alloc(locaux))
43  else
44  locaux = 1
45  endif
46  node(storeaux,mptr) = locaux
47  if (level .lt. mxnest) then
48  loc2 = igetsp(mitot*mjtot*nvar)
49  node(store2,mptr) = loc2
50  endif
51  rnode(timemult, mptr) = start_time
52  go to 30
53  20 continue
54 c
55 c if 2nd time through, put initial values in store2 so finer grids
56 c can be advanced with interpolation of their boundary values.
57 c new time soln should still be in location store1.
58 c
59  loc = node(store2,mptr)
60  locaux = node(storeaux,mptr)
61 c
62  30 continue
63  call qinit(nvar,nghost,nx,ny,corn1,corn2,hx,hy,
64  & alloc(loc),naux,alloc(locaux))
65 
66 c
67  mptr = node(levelptr, mptr)
68  if (mptr .ne. 0) go to 10
69 c
70 c
71  99 continue
72  return
73  end
function igetsp(nwords)
Definition: igetsp.f:4
subroutine ginit(msave, first, nvar, naux, start_time)
Definition: ginit.f:4
subroutine qinit(meqn, mbc, mx, my, xlower, ylower, dx, dy, q, maux, aux)
Definition: qinit.f90:2
subroutine setaux(mbc, mx, my, xlower, ylower, dx, dy, maux, aux)
Definition: setaux.f90:1