dxm2d_12.f
上传用户:ls4004p
上传日期:2007-08-05
资源大小:2314k
文件大小:2k
- C**********************************************************************
- C D X M 2 D
- 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(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, G4, G5, G6, dx
- INTEGER nx, nz, r, c, INIT,
- & ZA, ZE, SA, SE
-
- SAVE F1, G1, G2, G3, G4, G5, G6, INIT
- DATA INIT /0/
-
- IF (INIT .eq. 0) THEN
- INIT = 1
- F1 = 1. / dx
- G1 = 1.22133636474609 / dx
- G2 = -0.09693145751953116 / dx
- G3 = 0.01744766235351561 / dx
- G4 = -2.967289515904012E-3 /dx
- G5 = 3.590053982204854E-4 /dx
- G6 = -2.184781161221585E-5 /dx
- ENDIF
- DO r=1,nz
- DO c = 1 , SA-1
- OUT(c,r) = 0.
- ENDDO
- DO c = SE+1 , nx
- OUT(c,r) = 0.
- ENDDO
- ENDDO
- DO r=1, ZA-1
- DO c=SA,SE
- OUT(c,r) = 0.
- ENDDO
- ENDDO
-
- DO r = ZA , ZE
- DO c = SA , SA+5
- OUT(c,r) = F1 * (IN(c,r) - IN(c-1,r))
- ENDDO
- DO c = SA+6 , SE-5
- 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)) +
- & G4 * (IN(c+3,r) - IN(c-4,r)) +
- & G5 * (IN(c+4,r) - IN(c-5,r)) +
- & G6 * (IN(c+5,r) - IN(c-6,r))
- ENDDO
- DO c = SE-4 , SE
- OUT(c,r) = F1 * (IN(c,r) - IN(c-1,r))
- ENDDO
- ENDDO
-
- DO r = ZE+1 , nz
- DO c = SA , SE
- OUT(c,r) = 0.0
- ENDDO
- ENDDO
- RETURN
- END