Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
calcslope.f
Go to the documentation of this file.
1  function calc_slope (time, npts, pts, ltime)
2 c
3 c-------Description--------------------------------------------------
4 c
5 c Source File: calcslope.f
6 c
7 c Author/Date: Kelley Fugelso, 1265 (SEA) 04/89
8 c Rick Spielman, ISU 2014-03-24
9 c
10 c 2014-02-06 RBS: Changed real*4 to real
11 c 2014-03-24 RBS: Made it explicit that we generate variable L as well
12 c 2014-03-24 RBS: Copied over calcres.f to calculate slope for dL/dt
13 c
14 c Purpose: This subroutine generates the slope of the resistance
15 c (inductance) by interpolating using time as the indepdent
16 c variable. pts(i) i=1,3,5,... are the independent variable
17 c parameters and pts(i) i=2,4,6,... are the dependent variable
18 c parameters. ltime points to the last independent variable in
19 c pts which the previous time was less than (speeds up the
20 c lookup).
21 c
22 c Called by: Subroutine GET_TABLEM_VALUE
23 c
24 c Calls: none
25 c
26 c-------Input Parameters--------------------------------------------
27 c
28  integer npts, ! Number of points in array pts */
29  + ltime ! Pointer to last time used in lookup */
30  real time, ! Current problem time */
31  + pts(npts) ! Array of independent & dependent vals */
32 c
33 c-------Constants---------------------------------------------------
34 c
35  parameter(almost0 = 1.0e-12)
36  parameter(ralmost0 = 1.0 / almost0)
37 c
38 c-------Function Body-----------------------------------------------
39 c
40 c Find the endpoints for the independent variable.
41 c
42  if ((time .lt. pts(1)) .or. (time .gt. pts(npts-1))) then
43  calc_slope = 0.0
44  ltime = 0
45  return
46  end if
47 c
48 c Use lasttime to set the looping.
49 c
50  if (ltime .lt. 3) then
51  i = 3
52  else
53  i = ltime
54  end if
55  time1 = pts(i-2)
56  time2 = pts(i)
57 c
58 c Set the index to the point in the table which brackets the current time.
59 c
60  do while ((time .lt. time1) .or. (time .gt. time2))
61  i = i + 2
62  time1 = time2
63  time2 = pts(i)
64  end do
65 c
66 c Set the time difference of the two table points and set the time incremented
67 c since the first table time point.
68 c Then interpolate to find the function.
69 c
70  tdiff = amax1((time2-time1), almost0)
71  tdel = time - time1
72  slope = (pts(i+1) - pts(i-1)) / tdiff
73  calc_slope = slope
74 c
75  ltime = i
76 c
77 c-------Function End------------------------------------------------------
78 
79  return
80  end
function calc_slope(time, npts, pts, ltime)
Definition: calcslope.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field time
Definition: zdemfmt.h:85