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 /*     CALCULATE LEGENDRE FUNCTIONS */
17 /* ********************************************************************** */
18 /*     Copyright (C) 2000-2004 GFD Dennou Club. All rights reserved. */
19 /* ----------------------------------------------------------------------- */
shpfun_(integer * mm,integer * jm,integer * m,real * fun,real * pm,real * ys,real * yc,real * py,real * r__)20 /* Subroutine */ int shpfun_(integer *mm, integer *jm, integer *m, real *fun,
21 	real *pm, real *ys, real *yc, real *py, real *r__)
22 {
23     /* System generated locals */
24     integer fun_dim1, fun_offset, pm_dim1, pm_offset, py_dim2, py_offset,
25 	    i__1, i__2;
26 
27     /* Local variables */
28     static integer j, n, ip;
29     extern /* Subroutine */ int shppma_(integer *, integer *, integer *, real
30 	    *, real *, real *, real *);
31 
32     /* Parameter adjustments */
33     --r__;
34     py_dim2 = *jm - 0 + 1;
35     py_offset = 1 + 2 * (0 + py_dim2 * 0);
36     py -= py_offset;
37     pm_dim1 = *mm + 1 - 0 + 1;
38     pm_offset = 0 + pm_dim1 * 0;
39     pm -= pm_offset;
40     fun_dim1 = *jm - (-(*jm)) + 1;
41     fun_offset = -(*jm) + fun_dim1 * *m;
42     fun -= fun_offset;
43 
44     /* Function Body */
45     shppma_(mm, jm, m, &pm[pm_offset], ys, &py[py_offset], &r__[1]);
46     j = 0;
47     i__1 = *mm;
48     for (n = *m; n <= i__1; ++n) {
49 	fun[j + n * fun_dim1] = pm[n + j * pm_dim1];
50 /* L10: */
51     }
52     ip = -1;
53     i__1 = *mm;
54     for (n = *m; n <= i__1; ++n) {
55 	ip = -ip;
56 	i__2 = *jm;
57 	for (j = 1; j <= i__2; ++j) {
58 	    fun[j + n * fun_dim1] = pm[n + j * pm_dim1];
59 	    fun[-j + n * fun_dim1] = pm[n + j * pm_dim1] * ip;
60 /* L20: */
61 	}
62 /* L30: */
63     }
64     if (*m != 0) {
65 	i__1 = *mm;
66 	for (n = *m; n <= i__1; ++n) {
67 	    i__2 = *jm;
68 	    for (j = 1; j <= i__2; ++j) {
69 		fun[j + n * fun_dim1] *= yc[j];
70 		fun[-j + n * fun_dim1] *= yc[j];
71 /* L40: */
72 	    }
73 /* L50: */
74 	}
75     }
76     return 0;
77 } /* shpfun_ */
78 
79