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