This commit is contained in:
ceriel 1991-10-07 16:59:33 +00:00
parent 0f16a0f6f8
commit 9cb2aa3286
162 changed files with 6703 additions and 0 deletions

View file

@ -0,0 +1,118 @@
LIST
Notice
README
Version.c
abort_.c
c_abs.c
c_cos.c
c_div.c
c_exp.c
c_log.c
c_sin.c
c_sqrt.c
cabs.c
d_abs.c
d_acos.c
d_asin.c
d_atan.c
d_atn2.c
d_cnjg.c
d_cos.c
d_cosh.c
d_dim.c
d_exp.c
d_imag.c
d_int.c
d_lg10.c
d_log.c
d_mod.c
d_nint.c
d_prod.c
d_sign.c
d_sin.c
d_sinh.c
d_sqrt.c
d_tan.c
d_tanh.c
derf_.c
derfc_.c
ef1asc_.c
ef1cmc_.c
erf_.c
erfc_.c
getarg_.c
getenv_.c
h_abs.c
h_dim.c
h_dnnt.c
h_indx.c
h_len.c
h_mod.c
h_nint.c
h_sign.c
hl_ge.c
hl_gt.c
hl_le.c
hl_lt.c
i_abs.c
i_dim.c
i_dnnt.c
i_indx.c
i_len.c
i_mod.c
i_nint.c
i_sign.c
iargc_.c
l_ge.c
l_gt.c
l_le.c
l_lt.c
libF77.xsum
main.c
makefile
pow_ci.c
pow_dd.c
pow_di.c
pow_hh.c
pow_ii.c
pow_ri.c
pow_zi.c
pow_zz.c
r_abs.c
r_acos.c
r_asin.c
r_atan.c
r_atn2.c
r_cnjg.c
r_cos.c
r_cosh.c
r_dim.c
r_exp.c
r_imag.c
r_int.c
r_lg10.c
r_log.c
r_mod.c
r_nint.c
r_sign.c
r_sin.c
r_sinh.c
r_sqrt.c
r_tan.c
r_tanh.c
s_cat.c
s_cmp.c
s_copy.c
s_paus.c
s_rnge.c
s_stop.c
sig_die.c
signal_.c
system_.c
z_abs.c
z_cos.c
z_div.c
z_exp.c
z_log.c
z_sin.c
z_sqrt.c

View file

@ -0,0 +1,113 @@
Version.c
abort_.c
c_abs.c
c_cos.c
c_div.c
c_exp.c
c_log.c
c_sin.c
c_sqrt.c
cabs.c
d_abs.c
d_acos.c
d_asin.c
d_atan.c
d_atn2.c
d_cnjg.c
d_cos.c
d_cosh.c
d_dim.c
d_exp.c
d_imag.c
d_int.c
d_lg10.c
d_log.c
d_mod.c
d_nint.c
d_prod.c
d_sign.c
d_sin.c
d_sinh.c
d_sqrt.c
d_tan.c
d_tanh.c
derf_.c
derfc_.c
ef1asc_.c
ef1cmc_.c
erf_.c
erfc_.c
getarg_.c
getenv_.c
h_abs.c
h_dim.c
h_dnnt.c
h_indx.c
h_len.c
h_mod.c
h_nint.c
h_sign.c
hl_ge.c
hl_gt.c
hl_le.c
hl_lt.c
i_abs.c
i_dim.c
i_dnnt.c
i_indx.c
i_len.c
i_mod.c
i_nint.c
i_sign.c
iargc_.c
l_ge.c
l_gt.c
l_le.c
l_lt.c
main.c
pow_ci.c
pow_dd.c
pow_di.c
pow_hh.c
pow_ii.c
pow_ri.c
pow_zi.c
pow_zz.c
r_abs.c
r_acos.c
r_asin.c
r_atan.c
r_atn2.c
r_cnjg.c
r_cos.c
r_cosh.c
r_dim.c
r_exp.c
r_imag.c
r_int.c
r_lg10.c
r_log.c
r_mod.c
r_nint.c
r_sign.c
r_sin.c
r_sinh.c
r_sqrt.c
r_tan.c
r_tanh.c
s_cat.c
s_cmp.c
s_copy.c
s_paus.c
s_rnge.c
s_stop.c
sig_die.c
signal_.c
system_.c
z_abs.c
z_cos.c
z_div.c
z_exp.c
z_log.c
z_sin.c
z_sqrt.c

View file

@ -0,0 +1,23 @@
/****************************************************************
Copyright 1990, 1991 by AT&T Bell Laboratories and Bellcore.
Permission to use, copy, modify, and distribute this software
and its documentation for any purpose and without fee is hereby
granted, provided that the above copyright notice appear in all
copies and that both that the copyright notice and this
permission notice and warranty disclaimer appear in supporting
documentation, and that the names of AT&T Bell Laboratories or
Bellcore or any of their entities not be used in advertising or
publicity pertaining to distribution of the software without
specific, written prior permission.
AT&T and Bellcore disclaim all warranties with regard to this
software, including all implied warranties of merchantability
and fitness. In no event shall AT&T or Bellcore be liable for
any special, indirect or consequential damages or any damages
whatsoever resulting from loss of use, data or profits, whether
in an action of contract, negligence or other tortious action,
arising out of or in connection with the use or performance of
this software.
****************************************************************/

View file

@ -0,0 +1,20 @@
If your system lacks onexit() and you are not using an ANSI C
compiler, then you should compile main.c with NO_ONEXIT defined.
See the comments about onexit in the makefile.
If your system has a double drem() function such that drem(a,b)
is the IEEE remainder function (with double a, b), then you may
wish to compile r_mod.c and d_mod.c with IEEE_drem defined.
To check for transmission errors, issue the command
make check
This assumes you have the xsum program whose source, xsum.c,
is distributed as part of "all from f2c/src". If you do not
have xsum, you can obtain xsum.c by sending the following E-mail
message to netlib@research.att.com
send xsum.c from f2c/src
The makefile assumes you have installed f2c.h in a standard
place (and does not cause recompilation when f2c.h is changed);
f2c.h comes with "all from f2c" (the source for f2c) and is
available separately ("f2c.h from f2c").

View file

@ -0,0 +1,18 @@
static char junk[] = "\n@(#)LIBF77 VERSION 2.01 31 May 1991\n";
/*
2.00 11 June 1980. File version.c added to library.
2.01 31 May 1988. s_paus() flushes stderr; names of hl_* fixed
[ d]erf[c ] added
8 Aug. 1989: #ifdefs for f2c -i2 added to s_cat.c
29 Nov. 1989: s_cmp returns long (for f2c)
30 Nov. 1989: arg types from f2c.h
12 Dec. 1989: s_rnge allows long names
19 Dec. 1989: getenv_ allows unsorted environment
28 Mar. 1990: add exit(0) to end of main()
2 Oct. 1990: test signal(...) == SIG_IGN rather than & 01 in main
17 Oct. 1990: abort() calls changed to sig_die(...,1)
22 Oct. 1990: separate sig_die from main
25 Apr. 1991: minor, theoretically invisible tweaks to s_cat, sig_die
31 May 1991: make system_ return status
*/

View file

@ -0,0 +1,9 @@
#include "stdio.h"
#include "f2c.h"
extern VOID sig_die();
VOID abort_()
{
sig_die("Fortran abort routine called", 1);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double c_abs(z)
complex *z;
{
double cabs();
return( cabs( z->r, z->i ) );
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
VOID c_cos(r, z)
complex *r, *z;
{
double sin(), cos(), sinh(), cosh();
r->r = cos(z->r) * cosh(z->i);
r->i = - sin(z->r) * sinh(z->i);
}

View file

@ -0,0 +1,32 @@
#include "f2c.h"
extern VOID sig_die();
VOID c_div(c, a, b)
complex *a, *b, *c;
{
double ratio, den;
double abr, abi;
if( (abr = b->r) < 0.)
abr = - abr;
if( (abi = b->i) < 0.)
abi = - abi;
if( abr <= abi )
{
if(abi == 0)
sig_die("complex division by zero", 1);
ratio = (double)b->r / b->i ;
den = b->i * (1 + ratio*ratio);
c->r = (a->r*ratio + a->i) / den;
c->i = (a->i*ratio - a->r) / den;
}
else
{
ratio = (double)b->i / b->r ;
den = b->r * (1 + ratio*ratio);
c->r = (a->r + a->i*ratio) / den;
c->i = (a->i - a->r*ratio) / den;
}
}

View file

@ -0,0 +1,12 @@
#include "f2c.h"
VOID c_exp(r, z)
complex *r, *z;
{
double expx;
double exp(), cos(), sin();
expx = exp(z->r);
r->r = expx * cos(z->i);
r->i = expx * sin(z->i);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
VOID c_log(r, z)
complex *r, *z;
{
double log(), cabs(), atan2();
r->i = atan2(z->i, z->r);
r->r = log( cabs(z->r, z->i) );
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
VOID c_sin(r, z)
complex *r, *z;
{
double sin(), cos(), sinh(), cosh();
r->r = sin(z->r) * cosh(z->i);
r->i = cos(z->r) * sinh(z->i);
}

View file

@ -0,0 +1,25 @@
#include "f2c.h"
VOID c_sqrt(r, z)
complex *r, *z;
{
double mag, t, sqrt(), cabs();
if( (mag = cabs(z->r, z->i)) == 0.)
r->r = r->i = 0.;
else if(z->r > 0)
{
r->r = t = sqrt(0.5 * (mag + z->r) );
t = z->i / t;
r->i = 0.5 * t;
}
else
{
t = sqrt(0.5 * (mag - z->r) );
if(z->i < 0)
t = -t;
r->i = t;
t = z->i / t;
r->r = 0.5 * t;
}
}

View file

@ -0,0 +1,21 @@
double cabs(real, imag)
double real, imag;
{
double temp, sqrt();
if(real < 0)
real = -real;
if(imag < 0)
imag = -imag;
if(imag > real){
temp = real;
real = imag;
imag = temp;
}
if((real+imag) == real)
return(real);
temp = imag/real;
temp = real*sqrt(1.0 + temp*temp); /*overflow!!*/
return(temp);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double d_abs(x)
doublereal *x;
{
if(*x >= 0)
return(*x);
return(- *x);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_acos(x)
doublereal *x;
{
double acos();
return( acos(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_asin(x)
doublereal *x;
{
double asin();
return( asin(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_atan(x)
doublereal *x;
{
double atan();
return( atan(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_atn2(x,y)
doublereal *x, *y;
{
double atan2();
return( atan2(*x,*y) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
d_cnjg(r, z)
doublecomplex *r, *z;
{
r->r = z->r;
r->i = - z->i;
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_cos(x)
doublereal *x;
{
double cos();
return( cos(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_cosh(x)
doublereal *x;
{
double cosh();
return( cosh(*x) );
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
double d_dim(a,b)
doublereal *a, *b;
{
return( *a > *b ? *a - *b : 0);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_exp(x)
doublereal *x;
{
double exp();
return( exp(*x) );
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
double d_imag(z)
doublecomplex *z;
{
return(z->i);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double d_int(x)
doublereal *x;
{
double floor();
return( (*x>0) ? floor(*x) : -floor(- *x) );
}

View file

@ -0,0 +1,11 @@
#include "f2c.h"
#define log10e 0.43429448190325182765
double d_lg10(x)
doublereal *x;
{
double log();
return( log10e * log(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_log(x)
doublereal *x;
{
double log();
return( log(*x) );
}

View file

@ -0,0 +1,26 @@
#include "f2c.h"
double d_mod(x,y)
doublereal *x, *y;
{
#ifdef IEEE_drem
double drem(), xa, ya, z;
if ((ya = *y) < 0.)
ya = -ya;
z = drem(xa = *x, ya);
if (xa > 0) {
if (z < 0)
z += ya;
}
else if (z > 0)
z -= ya;
return z;
#else
double floor(), quotient;
if( (quotient = *x / *y) >= 0)
quotient = floor(quotient);
else
quotient = -floor(-quotient);
return(*x - (*y) * quotient );
#endif
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
double d_nint(x)
doublereal *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
double d_prod(x,y)
real *x, *y;
{
return( (*x) * (*y) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double d_sign(a,b)
doublereal *a, *b;
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_sin(x)
doublereal *x;
{
double sin();
return( sin(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_sinh(x)
doublereal *x;
{
double sinh();
return( sinh(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_sqrt(x)
doublereal *x;
{
double sqrt();
return( sqrt(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_tan(x)
doublereal *x;
{
double tan();
return( tan(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double d_tanh(x)
doublereal *x;
{
double tanh();
return( tanh(*x) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double derf_(x)
doublereal *x;
{
double erf();
return( erf(*x) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double derfc_(x)
doublereal *x;
{
double erfc();
return( erfc(*x) );
}

View file

@ -0,0 +1,15 @@
/* EFL support routine to copy string b to string a */
#include "f2c.h"
extern VOID s_copy();
#define M ( (long) (sizeof(long) - 1) )
#define EVEN(x) ( ( (x)+ M) & (~M) )
VOID ef1asc_(a, la, b, lb)
int *a, *b;
long int *la, *lb;
{
s_copy( (char *)a, (char *)b, EVEN(*la), *lb );
}

View file

@ -0,0 +1,12 @@
/* EFL support routine to compare two character strings */
#include "f2c.h"
extern integer s_cmp();
integer ef1cmc_(a, la, b, lb)
integer *a, *b;
integer *la, *lb;
{
return( s_cmp( (char *)a, (char *)b, *la, *lb) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double erf_(x)
real *x;
{
double erf();
return( erf(*x) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double erfc_(x)
real *x;
{
double erfc();
return( erfc(*x) );
}

View file

@ -0,0 +1,27 @@
#include "f2c.h"
/*
* subroutine getarg(k, c)
* returns the kth unix command argument in fortran character
* variable argument c
*/
VOID getarg_(n, s, ls)
long int *n;
register char *s;
long int ls;
{
extern int xargc;
extern char **xargv;
register char *t;
register int i;
if(*n>=0 && *n<xargc)
t = xargv[*n];
else
t = "";
for(i = 0; i<ls && *t!='\0' ; ++i)
*s++ = *t++;
for( ; i<ls ; ++i)
*s++ = ' ';
}

View file

@ -0,0 +1,49 @@
#include "f2c.h"
/*
* getenv - f77 subroutine to return environment variables
*
* called by:
* call getenv (ENV_NAME, char_var)
* where:
* ENV_NAME is the name of an environment variable
* char_var is a character variable which will receive
* the current value of ENV_NAME, or all blanks
* if ENV_NAME is not defined
*/
VOID getenv_(fname, value, flen, vlen)
char *value, *fname;
long int vlen, flen;
{
extern char **environ;
register char *ep, *fp, *flast;
register char **env = environ;
flast = fname + flen;
for(fp = fname ; fp < flast ; ++fp)
if(*fp == ' ')
{
flast = fp;
break;
}
while (ep = *env++)
{
for(fp = fname; fp<flast ; )
if(*fp++ != *ep++)
goto endloop;
if(*ep++ == '=') { /* copy right hand side */
while( *ep && --vlen>=0 )
*value++ = *ep++;
goto blank;
}
endloop: ;
}
blank:
while( --vlen >= 0 )
*value++ = ' ';
}

View file

@ -0,0 +1,11 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_abs(x)
shortint *x;
{
if(*x >= 0)
return(*x);
return(- *x);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_dim(a,b)
shortint *a, *b;
{
return( *a > *b ? *a - *b : 0);
}

View file

@ -0,0 +1,12 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_dnnt(x)
doublereal *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,26 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_indx(a, b, la, lb)
char *a, *b;
long int la, lb;
{
int i, n;
char *s, *t, *bend;
n = la - lb + 1;
bend = b + lb;
for(i = 0 ; i < n ; ++i)
{
s = a + i;
t = b;
while(t < bend)
if(*s++ != *t++)
goto no;
return(i+1);
no: ;
}
return(0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_len(s, n)
char *s;
long int n;
{
return(n);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_mod(a,b)
short *a, *b;
{
return( *a % *b);
}

View file

@ -0,0 +1,12 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_nint(x)
real *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,11 @@
#include "f2c.h"
extern integer s_cmp();
shortint h_sign(a,b)
shortint *a, *b;
{
shortint x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
shortint hl_ge(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) >= 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
shortint hl_gt(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) > 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
shortint hl_le(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) <= 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
shortint hl_lt(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) < 0);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
integer i_abs(x)
integer *x;
{
if(*x >= 0)
return(*x);
return(- *x);
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
integer i_dim(a,b)
integer *a, *b;
{
return( *a > *b ? *a - *b : 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
integer i_dnnt(x)
doublereal *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,24 @@
#include "f2c.h"
integer i_indx(a, b, la, lb)
char *a, *b;
long int la, lb;
{
long int i, n;
char *s, *t, *bend;
n = la - lb + 1;
bend = b + lb;
for(i = 0 ; i < n ; ++i)
{
s = a + i;
t = b;
while(t < bend)
if(*s++ != *t++)
goto no;
return(i+1);
no: ;
}
return(0);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
integer i_len(s, n)
char *s;
long int n;
{
return(n);
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
integer i_mod(a,b)
integer *a, *b;
{
return( *a % *b);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
integer i_nint(x)
real *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
integer i_sign(a,b)
integer *a, *b;
{
integer x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
integer iargc_()
{
extern int xargc;
return ( xargc - 1 );
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
integer l_ge(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) >= 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
integer l_gt(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) > 0);
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
extern integer s_cmp();
integer l_le(a,b,la,lb)
char *a, *b;
long int la, lb;
{
return(s_cmp(a,b,la,lb) <= 0);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
integer l_lt(a,b,la,lb)
char *a, *b;
long la, lb;
{
return(s_cmp(a,b,la,lb) < 0);
}

View file

@ -0,0 +1,116 @@
Notice fb5a412e 1183
README 129e17de 902
Version.c f4072818 752
abort_.c 1ddc061a 123
c_abs.c 3ccfc99 96
c_cos.c 1d2a43cc 157
c_div.c f08f5e0a 556
c_exp.c f26ec4d4 165
c_log.c ea713636 145
c_sin.c eedb2a9 155
c_sqrt.c e863dae 348
cabs.c 514923b 309
d_abs.c 8525b15 92
d_acos.c e4d05af5 89
d_asin.c f0d01384 89
d_atan.c 1110dced 89
d_atn2.c e098ae4 100
d_cnjg.c e3e9622f 85
d_cos.c ed9f8b7c 86
d_cosh.c 19d05b3e 89
d_dim.c e458c4ea 91
d_exp.c ef428642 86
d_imag.c c057bf1 71
d_int.c 1e86e392 115
d_lg10.c a976032 136
d_log.c 4d50239 86
d_mod.c ea39a739 415
d_nint.c fcbb75a8 126
d_prod.c 1a6760da 77
d_sign.c f80806fe 124
d_sin.c 4d62b63 86
d_sinh.c e0c61add 89
d_sqrt.c ec746103 89
d_tan.c e19875b1 86
d_tanh.c 1a4903ee 89
derf_.c f82e7a98 87
derfc_.c 17681562 90
ef1asc_.c 10a294bd 285
ef1cmc_.c e2000a1f 221
erf_.c e51d2afe 80
erfc_.c 1eeada84 83
getarg_.c f7e5a7e2 415
getenv_.c f2fbc977 881
h_abs.c f17a9d28 117
h_dim.c efa53d0c 116
h_dnnt.c 1b6e30b4 153
h_indx.c e541126 302
h_len.c e5f0ba39 100
h_mod.c e5070b30 99
h_nint.c f2f6a9b6 147
h_sign.c e0424bd3 151
hl_ge.c f34d97c0 134
hl_gt.c 1e9364c1 133
hl_le.c 68dbb84 134
hl_lt.c 3f5ec5a 133
i_abs.c e9df85da 90
i_dim.c f93e306f 89
i_dnnt.c 1c51efb 127
i_indx.c b222d76 281
i_len.c 17926ad5 74
i_mod.c 6b15148 75
i_nint.c f3e91f29 121
i_sign.c e8e073b2 123
iargc_.c fd9410d9 79
l_ge.c 1adab0fd 132
l_gt.c e9f5bde3 131
l_le.c ef1a9cb9 132
l_lt.c fb4a7a8c 102
main.c ef83b695 1362
makefile ef8a327a 2943
pow_ci.c 62b6caf 186
pow_dd.c e1caeeb1 104
pow_di.c ec10f0b0 325
pow_hh.c e4161aa7 245
pow_ii.c d0fbe46 242
pow_ri.c fbdbece8 319
pow_zi.c e87e82cc 518
pow_zz.c fde95b82 312
r_abs.c 1b85bc 86
r_acos.c 11eeee20 83
r_asin.c e7b27881 83
r_atan.c 8920297 83
r_atn2.c 4ac36c3 94
r_cnjg.c e5db6724 84
r_cos.c e07cb241 80
r_cosh.c f51deb04 83
r_dim.c 10a3ddd9 85
r_exp.c 13e47ded 80
r_imag.c 1703a645 65
r_int.c c849cbb 109
r_lg10.c 187b31e7 130
r_log.c e5240928 80
r_mod.c 7894f0d 417
r_nint.c ff0c2044 120
r_sign.c fc88b617 118
r_sin.c 14626334 80
r_sinh.c ea3a24ec 83
r_sqrt.c e685c7f1 83
r_tan.c ff2454a8 80
r_tanh.c fa01b1c7 83
s_cat.c 60770ce 294
s_cmp.c 1aceca99 507
s_copy.c 1783e78d 279
s_paus.c f398b5e3 746
s_rnge.c 7eaeb87 513
s_stop.c f1f95e02 238
sig_die.c f0fbd1a3 391
signal_.c 1fd402d7 234
system_.c 5d071f1 287
z_abs.c f33e298 102
z_cos.c 281d763 163
z_div.c 8b4794a 547
z_exp.c 1e060b77 171
z_log.c f92a692d 153
z_sin.c 8cb5ee6 161
z_sqrt.c f0e4dfde 332

View file

@ -0,0 +1,95 @@
/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */
#include "stdio.h"
#include "signal.h"
#ifndef SIGIOT
#define SIGIOT SIGABRT
#endif
#ifdef NO__STDC
#define ONEXIT onexit
extern void f_exit();
#else
#ifdef __STDC__
#include "stdlib.h"
extern void f_exit(void);
#ifndef NO_ONEXIT
#define ONEXIT atexit
extern int atexit(void (*)(void));
#endif
#else
#ifndef NO_ONEXIT
#define ONEXIT onexit
extern void f_exit();
#endif
#endif
#endif
extern void sig_die();
static void sigfdie(n)
{
sig_die("Floating Exception", 1);
}
static void sigidie(n)
{
sig_die("IOT Trap", 1);
}
#ifdef SIGQUIT
static void sigqdie(n)
{
sig_die("Quit signal", 1);
}
#endif
static void sigindie(n)
{
sig_die("Interrupt", 0);
}
static void sigtdie(n)
{
sig_die("Killed", 0);
}
int xargc;
char **xargv;
main(argc, argv)
int argc;
char **argv;
{
xargc = argc;
xargv = argv;
signal(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
signal(SIGIOT, sigidie);
#ifdef SIGQUIT
if(signal(SIGQUIT,sigqdie) == SIG_IGN)
signal(SIGQUIT, SIG_IGN);
#endif
if(signal(SIGINT, sigindie) == SIG_IGN)
signal(SIGINT, SIG_IGN);
signal(SIGTERM,sigtdie);
#ifdef pdp11
ldfps(01200); /* detect overflow as an exception */
#endif
f_init();
#ifndef NO_ONEXIT
ONEXIT(f_exit);
#endif
MAIN__();
#ifdef NO_ONEXIT
f_exit();
#endif
exit(0); /* exit(0) rather than return(0) to bypass Cray bug */
}

View file

@ -0,0 +1,74 @@
.SUFFIXES: .c .o
CC = cc
SHELL = /bin/sh
# compile, then strip unnecessary symbols
.c.o:
$(CC) -O -c -DSkip_f2c_Undefs $*.c
ld -r -x $*.o
mv a.out $*.o
MISC = Version.o main.o s_rnge.o abort_.o getarg_.o iargc_.o getenv_.o\
signal_.o s_stop.o s_paus.o system_.o cabs.o\
derf_.o derfc_.o erf_.o erfc_.o sig_die.o
POW = pow_ci.o pow_dd.o pow_di.o pow_hh.o pow_ii.o pow_ri.o pow_zi.o pow_zz.o
CX = c_abs.o c_cos.o c_div.o c_exp.o c_log.o c_sin.o c_sqrt.o
DCX = z_abs.o z_cos.o z_div.o z_exp.o z_log.o z_sin.o z_sqrt.o
REAL = r_abs.o r_acos.o r_asin.o r_atan.o r_atn2.o r_cnjg.o r_cos.o\
r_cosh.o r_dim.o r_exp.o r_imag.o r_int.o\
r_lg10.o r_log.o r_mod.o r_nint.o r_sign.o\
r_sin.o r_sinh.o r_sqrt.o r_tan.o r_tanh.o
DBL = d_abs.o d_acos.o d_asin.o d_atan.o d_atn2.o\
d_cnjg.o d_cos.o d_cosh.o d_dim.o d_exp.o\
d_imag.o d_int.o d_lg10.o d_log.o d_mod.o\
d_nint.o d_prod.o d_sign.o d_sin.o d_sinh.o\
d_sqrt.o d_tan.o d_tanh.o
INT = i_abs.o i_dim.o i_dnnt.o i_indx.o i_len.o i_mod.o i_nint.o i_sign.o
HALF = h_abs.o h_dim.o h_dnnt.o h_indx.o h_len.o h_mod.o h_nint.o h_sign.o
CMP = l_ge.o l_gt.o l_le.o l_lt.o hl_ge.o hl_gt.o hl_le.o hl_lt.o
EFL = ef1asc_.o ef1cmc_.o
CHAR = s_cat.o s_cmp.o s_copy.o
libF77.a : $(MISC) $(POW) $(CX) $(DCX) $(REAL) $(DBL) $(INT) \
$(HALF) $(CMP) $(EFL) $(CHAR)
ar r libF77.a $?
ranlib libF77.a
Version.o: Version.c
$(CC) -c Version.c
# If your system lacks onexit() and you are not using an
# ANSI C compiler, then you should uncomment the following
# two lines (for compiling main.o):
#main.o: main.c
# $(CC) -c -DNO_ONEXIT -DSkip_f2c_Undefs main.c
# On at least some Sun systems, it is more appropriate to
# uncomment the following two lines:
#main.o: main.c
# $(CC) -c -Donexit=on_exit -DSkip_f2c_Undefs main.c
install: libF77.a
mv libF77.a /usr/lib
clean:
rm -f libF77.a *.o
check:
xsum Notice README Version.c abort_.c c_abs.c c_cos.c c_div.c \
c_exp.c c_log.c c_sin.c c_sqrt.c cabs.c d_abs.c d_acos.c \
d_asin.c d_atan.c d_atn2.c d_cnjg.c d_cos.c d_cosh.c d_dim.c \
d_exp.c d_imag.c d_int.c d_lg10.c d_log.c d_mod.c d_nint.c \
d_prod.c d_sign.c d_sin.c d_sinh.c d_sqrt.c d_tan.c d_tanh.c \
derf_.c derfc_.c ef1asc_.c ef1cmc_.c erf_.c erfc_.c getarg_.c \
getenv_.c h_abs.c h_dim.c h_dnnt.c h_indx.c h_len.c h_mod.c \
h_nint.c h_sign.c hl_ge.c hl_gt.c hl_le.c hl_lt.c i_abs.c \
i_dim.c i_dnnt.c i_indx.c i_len.c i_mod.c i_nint.c i_sign.c \
iargc_.c l_ge.c l_gt.c l_le.c l_lt.c main.c makefile pow_ci.c \
pow_dd.c pow_di.c pow_hh.c pow_ii.c pow_ri.c pow_zi.c pow_zz.c \
r_abs.c r_acos.c r_asin.c r_atan.c r_atn2.c r_cnjg.c r_cos.c \
r_cosh.c r_dim.c r_exp.c r_imag.c r_int.c r_lg10.c r_log.c \
r_mod.c r_nint.c r_sign.c r_sin.c r_sinh.c r_sqrt.c r_tan.c \
r_tanh.c s_cat.c s_cmp.c s_copy.c s_paus.c s_rnge.c s_stop.c \
sig_die.c signal_.c system_.c z_abs.c z_cos.c z_div.c z_exp.c \
z_log.c z_sin.c z_sqrt.c >zap
cmp zap libF77.xsum && rm zap || diff libF77.xsum zap

View file

@ -0,0 +1,16 @@
#include "f2c.h"
VOID pow_ci(p, a, b) /* p = a**b */
complex *p, *a;
integer *b;
{
doublecomplex p1, a1;
a1.r = a->r;
a1.i = a->i;
pow_zi(&p1, &a1, b);
p->r = p1.r;
p->i = p1.i;
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double pow_dd(ap, bp)
doublereal *ap, *bp;
{
double pow();
return(pow(*ap, *bp) );
}

View file

@ -0,0 +1,36 @@
#include "f2c.h"
double pow_di(ap, bp)
doublereal *ap;
integer *bp;
{
double pow, x;
integer n;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
{
if(n < 0)
{
if(x == 0)
{
return(pow);
}
n = -n;
x = 1/x;
}
for( ; ; )
{
if(n & 01)
pow *= x;
if(n >>= 1)
x *= x;
else
break;
}
}
return(pow);
}

View file

@ -0,0 +1,25 @@
#include "f2c.h"
shortint pow_hh(ap, bp)
shortint *ap, *bp;
{
shortint pow, x, n;
pow = 1;
x = *ap;
n = *bp;
if(n < 0)
{ }
else if(n > 0)
for( ; ; )
{
if(n & 01)
pow *= x;
if(n >>= 1)
x *= x;
else
break;
}
return(pow);
}

View file

@ -0,0 +1,25 @@
#include "f2c.h"
integer pow_ii(ap, bp)
integer *ap, *bp;
{
integer pow, x, n;
pow = 1;
x = *ap;
n = *bp;
if(n < 0)
{ }
else if(n > 0)
for( ; ; )
{
if(n & 01)
pow *= x;
if(n >>= 1)
x *= x;
else
break;
}
return(pow);
}

View file

@ -0,0 +1,36 @@
#include "f2c.h"
double pow_ri(ap, bp)
real *ap;
integer *bp;
{
double pow, x;
integer n;
pow = 1;
x = *ap;
n = *bp;
if(n != 0)
{
if(n < 0)
{
if(x == 0)
{
return(pow);
}
n = -n;
x = 1/x;
}
for( ; ; )
{
if(n & 01)
pow *= x;
if(n >>= 1)
x *= x;
else
break;
}
}
return(pow);
}

View file

@ -0,0 +1,46 @@
#include "f2c.h"
VOID pow_zi(p, a, b) /* p = a**b */
doublecomplex *p, *a;
integer *b;
{
integer n;
double t;
doublecomplex x;
static doublecomplex one = {1.0, 0.0};
n = *b;
p->r = 1;
p->i = 0;
if(n == 0)
return;
if(n < 0)
{
n = -n;
z_div(&x, &one, a);
}
else
{
x.r = a->r;
x.i = a->i;
}
for( ; ; )
{
if(n & 01)
{
t = p->r * x.r - p->i * x.i;
p->i = p->r * x.i + p->i * x.r;
p->r = t;
}
if(n >>= 1)
{
t = x.r * x.r - x.i * x.i;
x.i = 2 * x.r * x.i;
x.r = t;
}
else
break;
}
}

View file

@ -0,0 +1,17 @@
#include "f2c.h"
VOID pow_zz(r,a,b)
doublecomplex *r, *a, *b;
{
double logr, logi, x, y;
double log(), exp(), cos(), sin(), atan2(), cabs();
logr = log( cabs(a->r, a->i) );
logi = atan2(a->i, a->r);
x = exp( logr * b->r - logi * b->i );
y = logr * b->i + logi * b->r;
r->r = x * cos(y);
r->i = x * sin(y);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double r_abs(x)
real *x;
{
if(*x >= 0)
return(*x);
return(- *x);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_acos(x)
real *x;
{
double acos();
return( acos(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_asin(x)
real *x;
{
double asin();
return( asin(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_atan(x)
real *x;
{
double atan();
return( atan(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_atn2(x,y)
real *x, *y;
{
double atan2();
return( atan2(*x,*y) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
VOID r_cnjg(r, z)
complex *r, *z;
{
r->r = z->r;
r->i = - z->i;
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_cos(x)
real *x;
{
double cos();
return( cos(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_cosh(x)
real *x;
{
double cosh();
return( cosh(*x) );
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
double r_dim(a,b)
real *a, *b;
{
return( *a > *b ? *a - *b : 0);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_exp(x)
real *x;
{
double exp();
return( exp(*x) );
}

View file

@ -0,0 +1,7 @@
#include "f2c.h"
double r_imag(z)
complex *z;
{
return(z->i);
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double r_int(x)
real *x;
{
double floor();
return( (*x>0) ? floor(*x) : -floor(- *x) );
}

View file

@ -0,0 +1,11 @@
#include "f2c.h"
#define log10e 0.43429448190325182765
double r_lg10(x)
real *x;
{
double log();
return( log10e * log(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_log(x)
real *x;
{
double log();
return( log(*x) );
}

View file

@ -0,0 +1,26 @@
#include "f2c.h"
double r_mod(x,y)
real *x, *y;
{
#ifdef IEEE_drem
double drem(), xa, ya, z;
if ((ya = *y) < 0.)
ya = -ya;
z = drem(xa = *x, ya);
if (xa > 0) {
if (z < 0)
z += ya;
}
else if (z > 0)
z -= ya;
return z;
#else
double floor(), quotient;
if( (quotient = (double)*x / *y) >= 0)
quotient = floor(quotient);
else
quotient = -floor(-quotient);
return(*x - (*y) * quotient );
#endif
}

View file

@ -0,0 +1,10 @@
#include "f2c.h"
double r_nint(x)
real *x;
{
double floor();
return( (*x)>=0 ?
floor(*x + .5) : -floor(.5 - *x) );
}

View file

@ -0,0 +1,9 @@
#include "f2c.h"
double r_sign(a,b)
real *a, *b;
{
double x;
x = (*a >= 0 ? *a : - *a);
return( *b >= 0 ? x : -x);
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_sin(x)
real *x;
{
double sin();
return( sin(*x) );
}

View file

@ -0,0 +1,8 @@
#include "f2c.h"
double r_sinh(x)
real *x;
{
double sinh();
return( sinh(*x) );
}

Some files were not shown because too many files have changed in this diff Show more