3.3.2 ODRKGR/ODRKGS/ODRK4R/ODRK4S

1.
Function

Performs two-step integration by ODRKG (ODRKGR, ODRKGS) or ODRK4 (ODRK4R, ODRK4S), and determines the appropriate DT while checking the precision. ODRKGS and ODRK4S performs two-step integration for a given DT, then calculates and returns the DT for the next step. In contrast, ODRKGR and ODRK4R repeats the calculation process when the required precision is not satisfied using a smaller value for DT.

2.
Call
CALL ODRKGR(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRKGS(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRK4R(N,FCN,T,DT,EPSL,X,WORK)
CALL ODRK4S(N,FCN,T,DT,EPSL,X,WORK)

3.
Explanation of Parameters
N (I) Number of variables of integration (integrands). (i)
FCN Name of procedure Name of subroutine that calculates DX.
T (R) Value of the independent variable t. It is outputted with the integration interval for the 2 steps added. (i/o)
DT (R) Step width of integration. It is changed to an appropriate value before being outputted. (i/o)
EPSL (R) Required precision. (i)
X R(N) Outputs the value at t=T+2¡ßDT for and inputted value of the variable of integration at t=T.
WORK R(N,M) Working variable. M=7 ( ODRK4R), M=5 ( ODRK4S, ODRKGR), M=3 ( ODRKGS).

4.
Notes
(a)
Compared to ODRKGR and ODRK4R, ODRKGS and ODRK4S uses less working area, but it will not repeat calculation even when the required precision is not satisfied. Therefore, the use of ODRKGR and ODRK4R is recommended whenever there is sufficient memory area available.
Note that ODRKGS and ODRK4S uses a slightly small safety factor when determining the value of DT, so it is effective when the equation has a gradual temporal change.
(b)
FCN is provided by the user in the form of a subroutine according to the following format:
SUBROUTINE FCN(N,T,X,DX).