dxp2d.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:2k
- C**********************************************************************
- C D X P 2 D
- C
- C Joachim Falk , Uni Hamburg , (0049)/(0) - 40 / 4123 5050
- C Institute for Geophysics
- C 11.07.1996
- C email falk@dkrz.de
- C
- C ZA, ZE = first and last grid-row of differentiation
- C SA, SE = first and last grid-column of differentiation
- C**********************************************************************
- SUBROUTINE DXP2D(IN,OUT, nx, nz, dx, ZA, ZE, SA, SE)
- IMPLICIT NONE
- INCLUDE 'param.f'
- REAL IN(MAXCOLS,MAXROWS), OUT(MAXCOLS,MAXROWS),
- & G1, G2, G3, F1, dx
- INTEGER nx, nz, r, c, INIT, ZA, ZE, SA, SE
-
- SAVE F1, G1, G2, G3
- DATA INIT /0/
-
- IF (INIT .eq. 0) THEN
- INIT = 1
- F1 = 1. / dx
- G1 = 75. / (64. * dx)
- G2 = -25. / (384. * dx)
- G3 = 3. / (640. * dx)
- ENDIF
- DO r=1,ZA-1
- DO c=SA,SE
- OUT(c,r) = 0.0
- ENDDO
- ENDDO
- DO r=1,nz
- DO c=1,SA-1
- OUT(c,r)=0.0
- ENDDO
- DO c=SE+1,nx
- OUT(c,r)=0.0
- ENDDO
- ENDDO
- DO r = ZA , ZE
- DO c = SA , SA+1
- OUT(c,r)=F1*(IN(c+1,r)-IN(c,r))
- ENDDO
- DO c = SA+2 , SE-3
- C OUT(c,r) =
- C & F1 * (IN(c+1,r) - IN(c ,r)) ! second order
- OUT(c,r) = (
- & G1 * (IN(c+1,r) - IN(c ,r)) +
- & G2 * (IN(c+2,r) - IN(c-1,r)) +
- & G3 * (IN(c+3,r) - IN(c-2,r)) )
- ENDDO
- DO c = SE-2 , SE
- OUT(c,r) = F1*(IN(c+1,r)-IN(c,r))
- ENDDO
- ENDDO
- DO r=ZE+1,nz
- DO c=SA,SE
- OUT(c,r) = 0.0
- ENDDO
- ENDDO
- RETURN
- END