Blame view

highEkmanNLin/mudPackVar.f90 2.92 KB
af19620a   Kévin Duquette   Add all files
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
! This file include all mudpakc variable

!----------------------------------------------------------------------
!                         MudPack declaration
!---------------------------------------------------------------------- 

! set multigrid parameter
  parameter (nnx=iixp*2**(iiex-1)+1, nny=jjyq*2**(jjey-1)+1) 

! set work space length approximation for line-y relaxation (see mud2.d)
  parameter(isx=0,jsy=3)
  parameter (llwork=4*(nnx*nny*(10+isx+jsy)+8*(nnx+nny+2))/3)
        
! put integer and floating point argument names in contiguous
! storeage for labelling in vectors iprm,fprm
  integer iprmD(16),iprmN(16),mgopt(4)
   
  ! Dirichlet parameter
  integer intlD,nxaD,nxbD,nycD,nydD,ixpD,jyqD,iexD,jeyD,nxD,nyD,   &
            iguessD,maxcyD,methodD,nworkD,lwrkqdD,iteroD 
  common/itmud2D/intlD,nxaD,nxbD,nycD,nydD,ixpD,jyqD,iexD,jeyD,nxD,nyD,   &
            iguessD,maxcyD,methodD,nworkD,lwrkqdD,iteroD
  equivalence(intlD,iprmD)
  
  ! Neumman parameter
  integer intlN,nxaN,nxbN,nycN,nydN,ixpN,jyqN,iexN,jeyN,nxN,nyN,   &
            iguessN,maxcyN,methodN,nworkN,lwrkqdN,iteroN 
  common/itmud2N/intlN,nxaN,nxbN,nycN,nydN,ixpN,jyqN,iexN,jeyN,nxN,nyN,   &
            iguessN,maxcyN,methodN,nworkN,lwrkqdN,iteroN
  equivalence(intlN,iprmN)

  real fprm(6)
  real xa,xb,yc,yd,tolmax,relmax

  common/ftmud2/xa,xb,yc,yd,tolmax,relmax 
  equivalence(xa,fprm)
  integer i,j,ip,im,jp,jm,ierror
  real dlx,dly,x,y,cxx,cyy,cx,cy,ce,pxx,pyy,px,py,pe,errmax, workD(llwork), workN(llwork)

 
  ! declare coefficient and boundary condition input subroutines external
  external cof,bndc


! ----------------------------------------------------------------------!
!                         Set MudPack variable
!---------------------------------------------------------------------- 

! Check if nx and nnx are equale
  if (nx.NE.nnx.OR.ny.NE.nny) then
    print*, 'Check grid size nx and nnx!!', nx,nnx,ny,nny
    call exit(9)
  end if


! set grid sizes from parameter statements
  ixpD = iixp
  jyqD = jjyq
  iexD = iiex
  jeyD = jjey
  ixpN = iixp
  jyqN = jjyq
  iexN = iiex
  jeyN = jjey
  nxD = nnx
  nyD = nny
  nxN = nnx
  nyN = nny

! set multigrid arguments (w(2,1) cycling with fully weighted
! residual restriction and cubic prolongation)
  mgopt(1) = 0!1
  mgopt(2) = 0!2
  mgopt(3) = 0!1
  mgopt(4) = 0!3

! set for one cycle
  maxcyD = 100
  maxcyN = maxcyD

! set work space length approximation from parameter statement
  nworkD = llwork
  nworkN = llwork

  ! set line-y relaxation
  methodD = 0!1
  methodN = 0!1

  ! Boundary type
  nxaD = 0   ! Periodic
  nxbD = 0   ! Periodic
  nycD = 1   ! Dirichlet
  nydD = 1   ! Dirichlet
  nxaN = 0   ! Periodic
  nxbN = 0   ! Periodic
  nycN = 2   ! Neumman
  nydN = 2   ! Neumman



! set end points of solution rectangle in (x,y) space
  xa = 0.0
  xb = Lx
  yc = 0.0
  yd = Ly

! set mesh increments
 dlx = dx!(xb-xa)/float(nxD-1)
 dly = dy!(yd-yc)/float(nyD-1)

! set for no error control flag
  tolmax = 0.0