Debian Codegraph @

packages/seacas/applications/blot/initim.f

raw
1 C Copyright(C) 1999-2020 National Technology & Engineering Solutions
2 C of Sandia, LLC (NTESS). Under the terms of Contract DE-NA0003525 with
3 C NTESS, the U.S. Government retains certain rights in this software.
4 C
5 C See packages/seacas/LICENSE for details
6
7 C=======================================================================
8 SUBROUTINE INITIM (MAXTIM, WHONLY, NSTEPS, TIMES, WHOTIM,
9 & TMIN, TMAX, DELT, NINTV, NPTIMS, IPTIMS)
10 C=======================================================================
11
12 C --*** INITIM *** (TIMSEL) Initialize time step parameters
13 C -- Written by Amy Gilkey - revised 11/12/87
14 C --
15 C --INITIM initializes the time step parameters. The initialization
16 C --is dependent on the MAXTIM parameter.
17 C --
18 C --Parameters:
19 C -- MAXTIM - IN - the initialization parameter
20 C -- =0 - select all times
21 C -- >0 - select NINTV interval times (up to number of steps - 1)
22 C -- with interval starting at TMIN + offset
23 C -- <0 - select -NINTV interval times (up to number of steps)
24 C -- with interval starting at TMIN
25 C -- WHONLY - IN - true iff only whole times may be selected
26 C -- NSTEPS - IN - the number of time steps
27 C -- TIMES - IN - the database times
28 C -- WHOTIM - IN - true iff TIMES(i) is whole (versus history) time step
29 C -- TMIN - OUT - the minimum selected time; set to minimum time
30 C -- TMAX - OUT - the maximum selected time; set to maximum time
31 C -- DELT - OUT - the interval between selected times
32 C -- (<0 = selected times); set to 0 (for all times) or interval
33 C -- NINTV - IN/OUT - the number of times between tmin and tmax to select
34 C -- (negative for zero interval);
35 C -- NPTIMS - OUT - the number of selected times
36 C -- IPTIMS - OUT - the selected time step numbers
37
38 C --Routines Called:
39 C -- MINMAX - (etclib) Find minimum and maximum value
40 C -- MINMXL - (etclib) Find minimum and maximum value of selected values
41 C -- NUMEQL - (etclib) Count the number of equal values
42
43 LOGICAL WHONLY
44 REAL TIMES(*)
45 LOGICAL WHOTIM(*)
46 INTEGER IPTIMS(*)
47
48 IF (.NOT. WHONLY) THEN
49 CALL MINMAX (NSTEPS, TIMES, TMIN, TMAX)
50 ELSE
51 CALL MINMXL (NSTEPS, WHOTIM, TIMES, TMIN, TMAX)
52 END IF
53 IF (.NOT. WHONLY) THEN
54 NSTEPX = NSTEPS
55 ELSE
56 NSTEPX = NUMEQL (.TRUE., NSTEPS, WHOTIM)
57 END IF
58
59 IF (MAXTIM .NE. 0) THEN
60 IF (MAXTIM .GT. 0) THEN
61 NINTV = MIN (MAXTIM, NSTEPX-1)
62 ELSE
63 NINTV = - MIN (MAXTIM, NSTEPX)
64 END IF
65 DELT = 999.0
66
67 ELSE IF (MAXTIM .EQ. 0) THEN
68 DELT = 0.0
69 NINTV = 0
70 END IF
71
72 NPTIMS = -999
73 CALL CALTIM (WHONLY, TMIN, TMAX, DELT, NINTV,
74 & NSTEPS, TIMES, WHOTIM, NPTIMS, IPTIMS)
75 RETURN
76
77 END