higdon2d.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:12k
- C==========================================================================
- C Routinen InitBound , higx1, higxfs1, higx2, higxfs2,
- C , higz1, higzfs1, higz2, higzfs2
- C 07.04.1995 by Joachim Falk
- C implementation of 2D-Fields
- C==========================================================================
- subroutine initbound(lamu,mu,rho,dx,dz,
- & tvp,tvs,bvp,bvs,lvp,lvs,rvp,rvs,
- & nx,nz,dt,fs)
- implicit none
- include 'param.f'
- integer fs, nx , nz, r, i
- real mu(MAXCOLS,MAXROWS),lamu(MAXCOLS,MAXROWS),
- & rho(MAXCOLS,MAXROWS),
- & dx, dz,
- & tvp(MAXCOLS),tvs(MAXCOLS),bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS),
- & dt,hlp, hlp2
-
- hlp2 = sqrt(0.5)
- do r=1, nz
- IF (mu(1,r).gt.1.e5) THEN
- hlp = sqrt(mu(1,r) / rho(1,r)) * dt / dx
- lvp(r) = (1.-hlp) / (1.+hlp)
- lvs(r) = (hlp2-hlp) / (hlp2+hlp)
- C hlp = sqrt(lamu(1,r) / rho(1,r)) * dt / dx
- C lvp(r) = (1.-hlp) / (1.+hlp)
- C hlp = sqrt(mu(1,r) / rho(1,r)) * dt / dx
- C lvs(r) = (1.-hlp) / (1.+hlp)
- ELSE
- hlp = sqrt(lamu(1,r) / rho(1,r)) * dt / dx
- lvp(r) = (1.-hlp) / (1.+hlp)
- lvs(r) = (hlp2-hlp) / (hlp2+hlp)
- ENDIF
- hlp = lvp(r)
- lvp(r) = hlp + lvs(r)
- lvs(r) = hlp * lvs(r)
- IF (mu(nx,r).gt.1.e5) THEN
- hlp = sqrt(mu(nx,r) / rho(nx,r)) * dt / dx
- rvp(r) = (1.-hlp) / (1.+hlp)
- rvs(r) = (hlp2-hlp) / (hlp2+hlp)
- C hlp = sqrt(lamu(nx,r) / rho(nx,r)) * dt / dx
- C rvp(r) = (1.-hlp) / (1.+hlp)
- C hlp = sqrt(mu(nx,r) / rho(nx,r)) * dt / dx
- C rvs(r) = (1.-hlp) / (1.+hlp)
- ELSE
- hlp = sqrt(lamu(nx,r) / rho(nx,r)) * dt / dx
- rvp(r) = (1.-hlp) / (1.+hlp)
- rvs(r) = (hlp2-hlp) / (hlp2+hlp)
- ENDIF
- hlp = rvp(r)
- rvp(r) = hlp + rvs(r)
- rvs(r) = hlp * rvs(r)
- enddo
- do i = 1 , nx
- IF (mu(i,nz).gt.1.e5) THEN
- hlp = sqrt(mu(i,nz) / rho(i,nz)) * dt / dz
- bvp(i) = (1.-hlp) / (1.+hlp)
- hlp = sqrt(mu(i,nz) / rho(i,nz)) * dt / dz
- bvs(i) = (hlp2-hlp) / (hlp2+hlp)
- C hlp = sqrt(lamu(i,nz) / rho(i,nz)) * dt / dz
- C bvp(i) = (1.-hlp) / (1.+hlp)
- C hlp = sqrt(mu(i,nz) / rho(i,nz)) * dt / dz
- C bvs(i) = (1.-hlp) / (1.+hlp)
- ELSE
- hlp = sqrt(lamu(i,nz) / rho(i,nz)) * dt / dz
- bvp(i) = (1.-hlp) / (1.+hlp)
- bvs(i) = (hlp2-hlp) / (hlp2+hlp)
- ENDIF
- hlp = bvp(i)
- bvp(i) = hlp + bvs(i)
- bvs(i) = hlp * bvs(i)
- enddo
- if (fs.ne.1) then
- do i = 1 , nx
- IF (mu(i,1).gt.1.e5) THEN
- hlp = sqrt(mu(i,1) / rho(i,1)) * dt / dz
- tvp(i) = (1.-hlp) / (1.+hlp)
- tvs(i) = (hlp2-hlp) / (hlp2+hlp)
- C hlp = sqrt(lamu(i,1) / rho(i,1)) * dt / dz
- C tvp(i) = (1.-hlp) / (1.+hlp)
- C hlp = sqrt(mu(i,1) / rho(i,1)) * dt / dz
- C tvs(i) = (1.-hlp) / (1.+hlp)
- ELSE
- hlp = sqrt(lamu(i,1) / rho(i,1)) * dt / dz
- tvp(i) = (1.-hlp) / (1.+hlp)
- tvs(i) = (hlp2-hlp) / (hlp2+hlp)
- ENDIF
- hlp = tvp(i)
- tvp(i) = hlp + tvs(i)
- tvs(i) = hlp * tvs(i)
- enddo
- endif
- return
- end
- C==========================================================================
- subroutine HigX2(Ux,Uxo,tvp,tvs,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Ux(MAXCOLS,MAXROWS),Uxo(MAXCOLS,MAXROWS),
- & tvp(MAXCOLS),tvs(MAXCOLS),bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS)
-
- do c = 2 , nx-2
- Ux(c,1) = Ux(c,1) - tvp(c) * Ux(c,2) - tvs(c) * Ux(c,3)
- enddo
- in = nx-1 ! Spalte nx-1 Rand rechts (2.Durchlauf)
- do r = 2, nz-1 ! Schleife ueber re und li Rand (2.Durchlauf)
- Ux(1,r) = Ux(1,r) - lvp(r) * Ux(2,r) - lvs(r) * Ux(3,r)
- Ux(in,r) = Ux(in,r) - rvp(r)*Ux(in-1,r)-rvs(r)*Ux(in-2,r)
- enddo
-
- do c=2, nx-2
- Ux(c,nz) = Ux(c,nz) - bvp(c)*Ux(c,nz-1) - bvs(c)*Ux(c,nz-2)
- enddo
- return
- end
- C==========================================================================
- subroutine HigZ1(Uz,Uzo,tvp,tvs,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Uz(MAXCOLS,MAXROWS),Uzo(MAXCOLS,MAXROWS),
- & tvp(MAXCOLS),tvs(MAXCOLS),bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS),hlp
-
- do c=2, nx-1
- hlp = Uz(c,1)
- Uz(c,1) = 2.* Uz(c,2) - Uzo(c,3)
- & - tvp(c) * (Uzo(c,2) - Uz(c,3) - Uz(c,1))
- & - tvs(c) * (Uzo(c,1) - 2.* Uz(c,2))
- Uzo(c,1) = hlp
- enddo
- in = nx
- do r=2, nz-2 ! Rand links (erster Durchlauf)
- hlp = Uz(1,r)
- Uz(1,r) = 2. * Uz(2,r) - Uzo(3,r)
- & - lvp(r) * (Uzo(2,r) - Uz(3,r) - Uz(1,r))
- & - lvs(r) * (Uzo(1,r) - 2.*Uz(2,r))
- Uzo(1,r) = hlp
-
- hlp = Uz(in,r)
- Uz(in,r) = 2. * Uz(in-1,r) - Uzo(in-2,r)
- & - rvp(r) * (Uzo(in-1,r) - Uz(in-2,r) - Uz(in,r))
- & - rvs(r) * (Uzo(in,r) - 2.*Uz(in-1,r))
- Uzo(in,r) = hlp
- enddo
-
- in = nz-1
- do c=2, nx-1 ! Zeile nz-1
- hlp = Uz(c,in)
- Uz(c,in) = 2.* Uz(c,in-1) - Uzo(c,in-2)
- & - bvp(c) * (Uzo(c,in-1) - Uz(c,in-2) - Uz(c,in))
- & - bvs(c) * (Uzo(c,in) - 2.* Uz(c,in-1))
- Uzo(c,in) = hlp
- enddo
- return
- end
- C==========================================================================
- subroutine HigZ2(Uz,Uzo,tvp,tvs,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Uz(MAXCOLS,MAXROWS),Uzo(MAXCOLS,MAXROWS),
- & tvp(MAXCOLS),tvs(MAXCOLS),bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS)
- do c=2, nx-1 ! Zeile 1
- Uz(c,1) = Uz(c,1) - tvp(c) * Uz(c,2) - tvs(c) * Uz(c,3)
- enddo
- in = nx
- do r= 2 , nz-2
- Uz(1,r) = Uz(1,r) - lvp(r) * Uz(2,r) - lvs(r) * Uz(3,r)
- Uz(in,r) = Uz(in,r)-rvp(r) * Uz(in-1,r)-rvs(r)*Uz(in-2,r)
- enddo
- in = nz-1
- do c=2, nx-1 ! Zeile nz-1
- Uz(c,in) = Uz(c,in)-bvp(c)*Uz(c,in-1)-bvs(c)*Uz(c,in-2)
- enddo
- return
- end
- C============================================================================
- subroutine HigX1(Ux,Uxo,tvp,tvs,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Ux(MAXCOLS,MAXROWS),Uxo(MAXCOLS,MAXROWS),
- & tvp(MAXCOLS),tvs(MAXCOLS),bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS),hlp
-
- do c=2, nx-2
- hlp = Ux(c,1)
- Ux(c,1) = 2.* Ux(c,2) - Uxo(c,3)
- & - tvp(c) * (Uxo(c,2) - Ux(c,3) - Ux(c,1))
- & - tvs(c) * (Uxo(c,1) - 2.*Ux(c,2))
- Uxo(c,1) = hlp
- enddo
-
- in = nx-1
- do r=2 , nz-1
- hlp = Ux(1,r)
- Ux(1,r) = 2.* Ux(2,r) - Uxo(3,r)
- & - lvp(r) * (Uxo(2,r) - Ux(3,r) - Ux(1,r))
- & - lvs(r) * (Uxo(1,r) - 2.* Ux(2,r))
- Uxo(1,r) = hlp
- hlp = Ux(in,r)
- Ux(in,r) = 2.* Ux(in-1,r) - Uxo(in-2,r)
- & - rvp(r) * (Uxo(in-1,r) - Ux(in-2,r) - Ux(in,r))
- & - rvs(r) * (Uxo(in,r) - 2.* Ux(in-1,r))
- Uxo(in,r) = hlp
- enddo
-
- do c=2, nx-2 ! Rand unten (erster Durchlauf)
- hlp = Ux(c,nz)
- Ux(c,nz) = 2.* Ux(c,nz-1) - Uxo(c,nz-2)
- & - bvp(c) * (Uxo(c,nz-1) - Ux(c,nz-2) - Ux(c,nz))
- & - bvs(c) * (Uxo(c,nz) - 2.*Ux(c,nz-1))
- Uxo(c,nz) = hlp
- enddo
- return
- end
- C=========================================================================
- subroutine HigfsX1(Ux,Uxo,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Ux(MAXCOLS,MAXROWS),Uxo(MAXCOLS,MAXROWS),
- & bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS),hlp
-
- in = nx-1
- do r=1 , nz-1
- hlp = Ux(1,r)
- Ux(1,r) = 2.* Ux(2,r) - Uxo(3,r)
- & - lvp(r) * (Uxo(2,r) - Ux(3,r) - Ux(1,r))
- & - lvs(r) * (Uxo(1,r) - 2.* Ux(2,r))
- Uxo(1,r) = hlp
-
- hlp = Ux(in,r)
- Ux(in,r) = 2.* Ux(in-1,r) - Uxo(in-2,r)
- & - rvp(r) * (Uxo(in-1,r) - Ux(in-2,r) - Ux(in,r))
- & - rvs(r) * (Uxo(in,r) - 2.* Ux(in-1,r))
- Uxo(in,r) = hlp
- enddo
-
- in = nz
- do c=2, nx-2 ! Rand unten (erster Durchlauf)
- hlp = Ux(c,in)
- Ux(c,in) = 2.* Ux(c,in-1) - Uxo(c,in-2)
- & - bvp(c) * (Uxo(c,in-1) - Ux(c,in-2) - Ux(c,in))
- & - bvs(c) * (Uxo(c,in) - 2.*Ux(c,in-1))
- Uxo(c,in) = hlp
- enddo
- return
- end
- C============================================================================
- subroutine HigfsX2(Ux,Uxo,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Ux(MAXCOLS,MAXROWS),Uxo(MAXCOLS,MAXROWS),
- & bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS)
-
- in = nx-1
- do r= 1 , nz-1 ! Schleife ueber re und li Rand (2.Durchlauf)
- Ux(1,r) = Ux(1,r) - lvp(r) * Ux(2,r) - lvs(r) * Ux(3,r)
- Ux(in,r) = Ux(in,r)- rvp(r)*Ux(in-1,r) - rvs(r)*Ux(in-2,r)
- enddo
- do c=2, nx-2
- Ux(c,nz) = Ux(c,nz)-bvp(c)*Ux(c,nz-1) - bvs(c)*Ux(c,nz-2)
- enddo
- return
- end
- C============================================================================
- subroutine HigfsZ1(Uz,Uzo,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Uz(MAXCOLS,MAXROWS),Uzo(MAXCOLS,MAXROWS),
- & bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS),hlp
- do r=1 , nz-2
- hlp = Uz(1,r)
- Uz(1,r) = 2.0 * Uz(2,r) - Uzo(3,r)
- & - lvp(r) * (Uzo(2,r) - Uz(3,r) - Uz(1,r))
- & - lvs(r) * (Uzo(1,r) - 2.0 * Uz(2,r) )
- Uzo(1,r) = hlp
- hlp = Uz(nx,r)
- Uz(nx,r) = 2.0 * Uz(nx-1,r) - Uzo(nx-2,r)
- & - rvp(r) * (Uzo(nx-1,r) - Uz(nx-2,r) - Uz(nx,r))
- & - rvs(r) * (Uzo(nx,r) - 2.0 * Uz(nx-1,r) )
- Uzo(nx,r) = hlp
- enddo
- in = nz-1
- do c=2, nx-1
- hlp = Uz(c,in)
- Uz(c,in) = 2.0 * Uz(c,in-1) - Uzo(c,in-2)
- & - bvp(c) * (Uzo(c,in-1) - Uz(c,in-2) - Uz(c,in))
- & - bvs(c) * (Uzo(c,in) - 2.0 * Uz(c,in-1) )
- Uzo(c,in) = hlp
- enddo
- return
- end
- C============================================================================
- subroutine HigfsZ2(Uz,Uzo,bvp,bvs,lvp,lvs,rvp,rvs,nx,nz)
- implicit none
- include 'param.f'
- integer in, nx, nz, r, c
- real Uz(MAXCOLS,MAXROWS),Uzo(MAXCOLS,MAXROWS),
- & bvp(MAXCOLS),bvs(MAXCOLS),
- & lvp(MAXROWS),lvs(MAXROWS),rvp(MAXROWS),rvs(MAXROWS)
-
- do r= 1 , nz-2
- Uz(1,r) = Uz(1,r) - lvp(r) * Uz(2,r) - lvs(r) * Uz(3,r)
- Uz(nx,r) = Uz(nx,r) - rvp(r)*Uz(nx-1,r) - rvs(r)*Uz(nx-2,r)
- enddo
- in = nz-1
- do c=2, nx-1
- Uz(c,in) = Uz(c,in) - bvp(c)*Uz(c,in-1) - bvs(c)*Uz(c,in-2)
- enddo
- return
- end
- C============================================================================