#include "cfx5ext.h"
dllexport(get_timestep)
      SUBROUTINE get_timestep (
     &  NLOC,NRET,NARG,RET,ARGS,CRESLT,CZ,DZ,IZ,LZ,RZ)
CC
CD User routine: retrieves delta t stored in /USER directory
CC
CC --------------------
CC        Input
CC --------------------
CC
CC  NLOC   - size of current locale
CC  NRET   - number of components in result
CC  NARG   - number of arguments in call
CC  ARGS() - (NLOC,NARG) argument values
CC
CC --------------------
CC      Modified
CC --------------------
CC
CC  Stacks possibly.
CC
CC --------------------
CC        Output
CC --------------------
CC
CC  RET()  - (NLOC,NRET) return values
CC  CRESLT - 'GOOD' for success
CC
CC --------------------
CC       Details
CC --------------------
CC
CC======================================================================
C
C ------------------------------
C     Preprocessor includes
C ------------------------------
C
#include "MMS.h"
#include "cfd_constants.h"
C
C ------------------------------
C        Global Parameters
C ------------------------------
C
C
C ------------------------------
C        Argument list
C ------------------------------
C
      CHARACTER*(4) CRESLT
      CHARACTER CZ(*)*(1)   
C
      DOUBLE PRECISION DZ(*)
C
      INTEGER IZ(*)
      INTEGER NLOC,NARG,NRET
C
      LOGICAL LZ(*)
C
      REAL RZ(*)
      REAL ARGS(NLOC,NARG), RET(NLOC,NRET)
C
C
C ------------------------------
C        External routines
C ------------------------------
C
C
C ------------------------------
C        Local Parameters
C ------------------------------
C
C
C ------------------------------
C        Local Variables
C ------------------------------
C
      CHARACTER*(4) CRES
C
      REAL  DT
C
C ---------------------------
C    Executable Statements
C ---------------------------
C
C
C---- Set success flag.
C
      CRES = 'GOOD'
C
C---- Retrieves DT value. If there is none, it uses default the value
C     passed as argument.
C      
      CALL PEEKR('/USER/NEWDT',IONE,DT,'SKIP',CRES,RZ)
      IF (CRES .NE. 'GOOD') DT = ARGS(1,1)
      RET(1,1) = DT
C
      END
