dxm2d_a.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:2k
- C**********************************************************************
- C D X M 2 D _ A ( adding results to output-field )
- C
- C Joachim Falk , Uni Hamburg , (0049)/(0) - 40 / 4123 5047
- 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 DXM2D_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, INIT
- 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+2
- OUT(c,r) = MF(c,r)*(OUT(c,r)+F1*(IN(c,r)-IN(c-1,r)))
- ENDDO
- DO c = SA+3 , SE-2
- C OUT(c,r) = MF(c,r) * (OUT(c,r) +
- C & F1 * (IN(c ,r) - IN(c-1,r)) ) ! second order
- OUT(c,r) = MF(c,r) * (OUT(c,r) +
- & G1 * (IN(c ,r) - IN(c-1,r)) +
- & G2 * (IN(c+1,r) - IN(c-2,r)) +
- & G3 * (IN(c+2,r) - IN(c-3,r)) )
- ENDDO
- DO c = SE-1 , SE
- OUT(c,r) = MF(c,r)*(OUT(c,r)+F1*(IN(c,r)-IN(c-1,r)))
- ENDDO
- ENDDO
-
- RETURN
- END