tools.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:3k
- SUBROUTINE InitTapered(Coeff, Num, MinCoeff)
- IMPLICIT NONE
- INCLUDE 'param.f'
- REAL Coeff(MaxTapeCoeff), MinCoeff, a
- INTEGER Num, i
- C PRINT*
- C PRINT*, 'Begin InitTapered :'
- a = - log(MinCoeff) / (Num-1)**2
- C PRINT*, ' damping coeff. for tapered border: a= ', a
- DO i=1, Num
- Coeff(i) = exp(-(Num-i)**2 * a)
- ENDDO
- C PRINT*, 'Call InitTapered was succesful'
- RETURN
- END
- C____________________________________________________________________
- SUBROUTINE Taper(Ux, Uz, Coeff, nx, nz, nCoeff)
- IMPLICIT NONE
- INCLUDE 'param.f'
-
- INTEGER nx, nz, nCoeff, r, c,k
- REAL Ux(Maxcols,Maxrows),Uz(Maxcols,Maxrows),Coeff(MaxTapeCoeff)
- C Rand (Ux)
- DO k=1 , NCoeff
- c = k
- DO r=1, nz-k+1
- Ux(c,r) = Ux(c,r) * Coeff(k)
- ENDDO
- r = nz - k + 1
- DO c= k+1 , nx-k-1
- Ux(c,r) = Ux(c,r) * Coeff(k)
- ENDDO
- c = nx-k
- DO r = nz-k+1 , 1 , -1
- Ux(c,r) = Ux(c,r) * Coeff(k)
- ENDDO
- ENDDO
- C Rand (Uz)
- DO k=1 , NCoeff
- c = k
- DO r=1, nz-k
- Uz(c,r) = Uz(c,r) * Coeff(k)
- ENDDO
- r = nz - k
- DO c= k+1 , nx-k
- Uz(c,r) = Uz(c,r) * Coeff(k)
- ENDDO
- c = nx-k+1
- DO r = nz-k , 1 , -1
- Uz(c,r) = Uz(c,r) * Coeff(k)
- ENDDO
- ENDDO
- RETURN
- END
- C____________________________________________________________________
- SUBROUTINE taper42d(Ux, Uz, Coeff, nx, nz, nCoeff)
- IMPLICIT NONE
-
- INCLUDE 'param.f'
- REAL Ux(Maxcols,Maxrows), Uz(Maxcols,Maxrows), Coeff(MaxTapeCoeff)
- INTEGER nx, nz, nCoeff, r, c, rr
- C Rand (Ux)
- DO r=0, nCoeff-1
- rr=r+1
- DO c=1+r, nx-rr
- Ux(c,rr) = Ux(c,rr) * Coeff(rr)
- ENDDO
- DO c=2+r, nz-r
- Ux(nx-rr,c) = Ux(nx-rr,c) * Coeff(rr)
- ENDDO
- DO c=(nx-1)-rr, rr, -1
- Ux(c,nz-r) = Ux(c,nz-r) * Coeff(rr)
- ENDDO
- DO c=nz-rr, 1+rr, -1
- Ux(rr,c) = Ux(rr,c) * Coeff(rr)
- ENDDO
- ENDDO
- C Rand (Uz)
- DO r=0, nCoeff-1
- rr = r+1
- DO c=1+r, nx-r
- Uz(c,rr) = Uz(c,rr) * Coeff(rr)
- ENDDO
- DO c=2+r, (nz-rr)
- Uz(nx-r,c) = Uz(nx-r,c) * Coeff(rr)
- ENDDO
- DO c=(nx-1)-r, rr, -1
- Uz(c,nz-rr) = Uz(c,nz-rr) * Coeff(rr)
- ENDDO
- DO c=(nz-rr-1), 1+rr, -1
- Uz(rr,c) = Uz(rr,c) * Coeff(rr)
- ENDDO
- ENDDO
- RETURN
- END
- C-------------------------------------------------------------------------