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