dxp2d_a.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:2k
- C**********************************************************************
- C D X P 2 D _ A
- 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_A(IN,OUT, MF, nx, nz, dx, ZA, ZE, SA, SE)
- IMPLICIT NONE
- INCLUDE 'param.f'
- REAL IN(MAXCOLS,MAXROWS), OUT(MAXCOLS,MAXROWS),
- & MF(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 = ZA , ZE
- DO c = SA , SA+1
- OUT(c,r)=MF(c,r)*(OUT(c,r)+F1*(IN(c+1,r)-IN(c,r)))
- ENDDO
- DO c = SA+2 , SE-3
- C OUT(c,r) = MF(c,r) * (OUT(c,r) +
- C & F1 * (IN(c+1,r) - IN(c ,r)) ) ! second order
- OUT(c,r) = MF(c,r) * (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) = MF(c,r)*(OUT(c,r)+F1*(IN(c+1,r)-IN(c,r)) )
- ENDDO
- ENDDO
- RETURN
- END