Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0026/rkint.cdk
There are 2 other files named rkint.cdk in the archive. Click here to see a list.
$JOB RKINT[30,30]
$FORTRAN RKINT
C                                                                       RKIN  10
C     ..................................................................RKIN  20
C                                                                       RKIN  30
C        SAMPLE PROGRAM FOR RUNGE-KUTTA INTEGRATION OF A GIVEN FUNCTION RKIN  40
C        WITH TABULATED OUTPUT - RKINT                                  RKIN  50
C                                                                       RKIN  60
C        PURPOSE                                                        RKIN  70
C           INTEGRATES THE FUNCTION SUBPROGRAM FUN USING THE INITIAL    RKIN  80
C           CONDITIONS CONTAINED IN CONTROL CARDS.  PRODUCES TABULATED  RKIN  90
C           OUTPUT.                                                     RKIN 100
C                                                                       RKIN 110
C        REMARKS                                                        RKIN 120
C           NONE                                                        RKIN 130
C                                                                       RKIN 140
C        SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED                  RKIN 150
C           RK2                                                         RKIN 160
C           FUN - USER-SUPPLIED FUNCTION SUBPROGRAM GIVING              RKIN 170
C                 DY/DX=FUN(X,Y)                                        RKIN 180
C                                                                       RKIN 190
C        METHOD                                                         RKIN 200
C           READS CONTROL CARD CONTAINING INITIAL VALUES OF X AND Y,    RKIN 210
C           STEP SIZE, NUMBER OF STEPS DESIRED BETWEEN TABULATED VALUES,RKIN 220
C           AND NUMBER OF TABULATED VALUES REQUIRED. PROGRAM THEN ENTERSRKIN 230
C           RK2 TO PERFORM INTEGRATION. MULTIPLE CONTROL CARDS CAN BE   RKIN 240
C           USED ON THE SAME FUNCTION.                                  RKIN 250
C                                                                       RKIN 260
C     ..................................................................RKIN 270
C                                                                       RKIN 280
C        THE FOLLOWING DIMENSION MUST BE AS LARGE AS THE MAXIMUM        RKIN 290
C        NUMBER OF TABULATED VALUES DESIRED                             RKIN 300
C                                                                       RKIN 310
      DIMENSION A(500)                                                  RKIN 320
C                                                                       RKIN 330
      EXTERNAL FUN                                                      RKIN 340
C                                                                       RKIN 350
C        ...............................................................RKIN 360
C                                                                       RKIN 370
C        IF A DOUBLE PRECISION VERSION OF THIS ROUTINE IS DESIRED, THE  RKIN 380
C        C IN COLUMN 1 SHOULD BE REMOVED FROM THE DOUBLE PRECISION      RKIN 390
C        STATEMENT WHICH FOLLOWS.                                       RKIN 400
C                                                                       RKIN 410
C     DOUBLE PRECISION H,XO,YO,A,FUN                                    RKIN 420
C                                                                       RKIN 430
C        THE C MUST ALSO BE REMOVED FROM DOUBLE PRECISION STATEMENTS    RKIN 440
C        APPEARING IN OTHER ROUTINES USED IN CONJUNCTION WITH THIS      RKIN 450
C        ROUTINE.                                                       RKIN 460
C                                                                       RKIN 470
C        USER FUNCTION SUBPROGRAM, FUN, MUST BE IN DOUBLE PRECISION.    RKIN 480
C                                                                       RKIN 490
C        ...............................................................RKIN 500
C                                                                       RKIN 510
    1 FORMAT (3F10.0,2I5)                                               RKIN 520
    2 FORMAT(1H1,7X,44HSOLUTION OF DY/DX=FUN(X,Y) BY RK2 SUBROUTINE//   RKIN 530
     11H ,10X,2HH=,F7.3,2X,3HXO=,F7.3, 2X,3HYO=,F7.3//1H ,12X,1HX,18X,  RKIN 540
     24HY(X)//)                                                         RKIN 550
    3 FORMAT(1H ,10X,F5.2,10X,E15.8)                                    RKIN 560
C                                                                       RKIN 570
C        READ CONTROL CARD CONTAINING ITEMS LISTED UNDER METHOD.        RKIN 580
C                                                                       RKIN 590
   10 READ(5,1)XO,YO,H,JNT,IENT                                         RKIN 600
C                                                                       RKIN 610
C        CHECK IF CARD IS BLANK. IF SO, RETURN.                         RKIN 620
C                                                                       RKIN 630
      IF(IENT)20,40,20                                                  RKIN 640
C                                                                       RKIN 650
C        WRITE HEADING INFORMATION.                                     RKIN 660
C                                                                       RKIN 670
   20 WRITE(6,2)H,XO,YO                                                 RKIN 680
C                                                                       RKIN 690
C        PERFORM INTEGRATION                                            RKIN 700
C                                                                       RKIN 710
      CALL RK2(FUN,H,XO,YO,JNT,IENT,A)                                  RKIN 720
C                                                                       RKIN 730
C        WRITE OUTPUT                                                   RKIN 740
C                                                                       RKIN 750
      STEP=FLOAT(JNT)*H                                                 RKIN 760
      X=XO                                                              RKIN 770
      DO 30 I=1,IENT                                                    RKIN 780
      X=X+STEP                                                          RKIN 790
   30 WRITE(6,3)X,A(I)                                                  RKIN 800
C                                                                       RKIN 810
C        GO BACK AND CHECK FOR ADDITIONAL CONTROL CARD.                 RKIN 820
C                                                                       RKIN 830
      GO TO 10                                                          RKIN 840
   40 RETURN                                                            RKIN 850
      END                                                               RKIN 860
$FORTRAN FUN
      FUNCTION FUN(X,Y)                                                 FUN   10
C                                                                       FUN   20
      FUN=1./X                                                          FUN   30
      RETURN                                                            FUN   40
      END                                                               FUN   50
$DECK RKI.CDR
       1.0       0.0       .01   10   30                                      20
                                                                              30
$EOD
.ASSIGN CDR 5
.ASSIGN LPT 6
.SET CDR RKI
.EXECUTE/REL RKINT,FUN,WES:SSP/LIB
%FIN::
.DELETE RKI.CDR