1 /*  -- translated by f2c (version 20100827).
2    You must link the resulting object file with libf2c:
3 	on Microsoft Windows system, link with libf2c.lib;
4 	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
5 	or, if you install libf2c.a in a standard place, with -lf2c -lm
6 	-- in that order, at the end of the command line, as in
7 		cc *.o -lf2c -lm
8 	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
9 
10 		http://www.netlib.org/f2c/libf2c.zip
11 */
12 
13 #include "libtinyf2c.h"
14 
15 /* ----------------------------------------------------------------------- */
16 /*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved. */
17 /* ----------------------------------------------------------------------- */
rsum1_(real * rx,integer * n,integer * jx)18 real rsum1_(real *rx, integer *n, integer *jx)
19 {
20     /* System generated locals */
21     integer i__1, i__2;
22     real ret_val;
23 
24     /* Local variables */
25     static integer i__, nn;
26     static real sum, rmiss;
27     extern /* Subroutine */ int glrget_(char *, real *, ftnlen);
28 
29     /* Parameter adjustments */
30     --rx;
31 
32     /* Function Body */
33     glrget_("RMISS", &rmiss, (ftnlen)5);
34     sum = 0.f;
35     nn = 0;
36     i__1 = *jx * (*n - 1) + 1;
37     i__2 = *jx;
38     for (i__ = 1; i__2 < 0 ? i__ >= i__1 : i__ <= i__1; i__ += i__2) {
39 	if (rx[i__] != rmiss) {
40 	    ++nn;
41 	    sum += rx[i__];
42 	}
43 /* L10: */
44     }
45     if (nn == 0) {
46 	ret_val = rmiss;
47     } else {
48 	ret_val = sum;
49     }
50     return ret_val;
51 } /* rsum1_ */
52 
53