defer.f 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. *DECK DEFER
  2. SUBROUTINE DEFER (COFX, COFY, IDMN, USOL, GRHS)
  3. C***BEGIN PROLOGUE DEFER
  4. C***SUBSIDIARY
  5. C***PURPOSE Subsidiary to SEPELI
  6. C***LIBRARY SLATEC
  7. C***TYPE SINGLE PRECISION (DEFER-S)
  8. C***AUTHOR (UNKNOWN)
  9. C***DESCRIPTION
  10. C
  11. C This subroutine first approximates the truncation error given by
  12. C TRUN1(X,Y)=DLX**2*TX+DLY**2*TY where
  13. C TX=AFUN(X)*UXXXX/12.0+BFUN(X)*UXXX/6.0 on the interior and
  14. C at the boundaries if periodic (here UXXX,UXXXX are the third
  15. C and fourth partial derivatives of U with respect to X).
  16. C TX is of the form AFUN(X)/3.0*(UXXXX/4.0+UXXX/DLX)
  17. C at X=A or X=B if the boundary condition there is mixed.
  18. C TX=0.0 along specified boundaries. TY has symmetric form
  19. C in Y with X,AFUN(X),BFUN(X) replaced by Y,DFUN(Y),EFUN(Y).
  20. C The second order solution in USOL is used to approximate
  21. C (via second order finite differencing) the truncation error
  22. C and the result is added to the right hand side in GRHS
  23. C and then transferred to USOL to be used as a new right
  24. C hand side when calling BLKTRI for a fourth order solution.
  25. C
  26. C***SEE ALSO SEPELI
  27. C***ROUTINES CALLED DX, DY
  28. C***COMMON BLOCKS SPLPCM
  29. C***REVISION HISTORY (YYMMDD)
  30. C 801001 DATE WRITTEN
  31. C 890531 Changed all specific intrinsics to generic. (WRB)
  32. C 891214 Prologue converted to Version 4.0 format. (BAB)
  33. C 900402 Added TYPE section. (WRB)
  34. C***END PROLOGUE DEFER
  35. C
  36. COMMON /SPLPCM/ KSWX ,KSWY ,K ,L ,
  37. 1 AIT ,BIT ,CIT ,DIT ,
  38. 2 MIT ,NIT ,IS ,MS ,
  39. 3 JS ,NS ,DLX ,DLY ,
  40. 4 TDLX3 ,TDLY3 ,DLX4 ,DLY4
  41. DIMENSION GRHS(IDMN,*) ,USOL(IDMN,*)
  42. EXTERNAL COFX ,COFY
  43. C***FIRST EXECUTABLE STATEMENT DEFER
  44. DO 40 J=JS,NS
  45. YJ = CIT+(J-1)*DLY
  46. CALL COFY (YJ,DJ,EJ,FJ)
  47. DO 30 I=IS,MS
  48. XI = AIT+(I-1)*DLX
  49. CALL COFX (XI,AI,BI,CI)
  50. C
  51. C COMPUTE PARTIAL DERIVATIVE APPROXIMATIONS AT (XI,YJ)
  52. C
  53. CALL DX (USOL,IDMN,I,J,UXXX,UXXXX)
  54. CALL DY (USOL,IDMN,I,J,UYYY,UYYYY)
  55. TX = AI*UXXXX/12.0+BI*UXXX/6.0
  56. TY = DJ*UYYYY/12.0+EJ*UYYY/6.0
  57. C
  58. C RESET FORM OF TRUNCATION IF AT BOUNDARY WHICH IS NON-PERIODIC
  59. C
  60. IF (KSWX.EQ.1 .OR. (I.GT.1 .AND. I.LT.K)) GO TO 10
  61. TX = AI/3.0*(UXXXX/4.0+UXXX/DLX)
  62. 10 IF (KSWY.EQ.1 .OR. (J.GT.1 .AND. J.LT.L)) GO TO 20
  63. TY = DJ/3.0*(UYYYY/4.0+UYYY/DLY)
  64. 20 GRHS(I,J) = GRHS(I,J)+DLX**2*TX+DLY**2*TY
  65. 30 CONTINUE
  66. 40 CONTINUE
  67. C
  68. C RESET THE RIGHT HAND SIDE IN USOL
  69. C
  70. DO 60 I=IS,MS
  71. DO 50 J=JS,NS
  72. USOL(I,J) = GRHS(I,J)
  73. 50 CONTINUE
  74. 60 CONTINUE
  75. RETURN
  76. END