code62.f90

来自「Fortran 90 and HPF Programs Related to t」· F90 代码 · 共 35 行

F90
35
字号
!!!!!!!!!!!!!!!!!!!!!!!!!!!   Program 6.2   !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!                                                                       !! Please Note:                                                          !!                                                                       !! (1) This computer program is written by Tao Pang in conjunction with  !!     his book, "An Introduction to Computational Physics," published   !!     by Cambridge University Press in 1997.                            !!                                                                       !! (2) No warranties, express or implied, are made for this program.     !!                                                                       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!SUBROUTINE RLXN (FN,DN,S,N,P,H)!! Subroutine performing one iteration of Relaxation for the one-dimensional! stationary diffusion equation. DN is the diffusion coefficient shifted! half step towards x=0.  Copyright (c) Tao Pang 1997.!  IMPLICIT NONE  INTEGER, INTENT (IN) :: N  INTEGER :: I  REAL, INTENT (IN) :: H,P  REAL :: H2,Q  REAL, INTENT (IN), DIMENSION (N) :: DN,S  REAL, INTENT (INOUT), DIMENSION (N) :: FN!  H2 = H*H  Q  = 1.0-P  DO I = 2, N-1    FN(I) = Q*FN(I)+P*(DN(I+1)*FN(I+1)+DN(I)*FN(I-1)+H2*S(I))/(DN(I+1)+DN(I))  END DOEND SUBROUTINE RLXN

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?