⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 libf77

📁 把fortran语言编的程序转为c语言编的程序, 运行环境linux
💻
📖 第 1 页 / 共 5 页
字号:
//GO.SYSIN DD libF77/h_dim.cecho libF77/h_dnnt.c 1>&2sed >libF77/h_dnnt.c <<'//GO.SYSIN DD libF77/h_dnnt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-double floor();-shortint h_dnnt(x) doublereal *x;-#else-#undef abs-#include "math.h"-shortint h_dnnt(doublereal *x)-#endif-{-return( (*x)>=0 ?-	floor(*x + .5) : -floor(.5 - *x) );-}//GO.SYSIN DD libF77/h_dnnt.cecho libF77/h_indx.c 1>&2sed >libF77/h_indx.c <<'//GO.SYSIN DD libF77/h_indx.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-shortint h_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;-#else-shortint h_indx(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-ftnlen 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((shortint)i+1);-	no: ;-	}-return(0);-}//GO.SYSIN DD libF77/h_indx.cecho libF77/h_len.c 1>&2sed >libF77/h_len.c <<'//GO.SYSIN DD libF77/h_len.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-shortint h_len(s, n) char *s; ftnlen n;-#else-shortint h_len(char *s, ftnlen n)-#endif-{-return(n);-}//GO.SYSIN DD libF77/h_len.cecho libF77/h_mod.c 1>&2sed >libF77/h_mod.c <<'//GO.SYSIN DD libF77/h_mod.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-shortint h_mod(a,b) short *a, *b;-#else-shortint h_mod(short *a, short *b)-#endif-{-return( *a % *b);-}//GO.SYSIN DD libF77/h_mod.cecho libF77/h_nint.c 1>&2sed >libF77/h_nint.c <<'//GO.SYSIN DD libF77/h_nint.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-double floor();-shortint h_nint(x) real *x;-#else-#undef abs-#include "math.h"-shortint h_nint(real *x)-#endif-{-return( (*x)>=0 ?-	floor(*x + .5) : -floor(.5 - *x) );-}//GO.SYSIN DD libF77/h_nint.cecho libF77/h_sign.c 1>&2sed >libF77/h_sign.c <<'//GO.SYSIN DD libF77/h_sign.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-shortint h_sign(a,b) shortint *a, *b;-#else-shortint h_sign(shortint *a, shortint *b)-#endif-{-shortint x;-x = (*a >= 0 ? *a : - *a);-return( *b >= 0 ? x : -x);-}//GO.SYSIN DD libF77/h_sign.cecho libF77/hl_ge.c 1>&2sed >libF77/hl_ge.c <<'//GO.SYSIN DD libF77/hl_ge.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-shortlogical hl_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-shortlogical hl_ge(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) >= 0);-}//GO.SYSIN DD libF77/hl_ge.cecho libF77/hl_gt.c 1>&2sed >libF77/hl_gt.c <<'//GO.SYSIN DD libF77/hl_gt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-shortlogical hl_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-shortlogical hl_gt(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) > 0);-}//GO.SYSIN DD libF77/hl_gt.cecho libF77/hl_le.c 1>&2sed >libF77/hl_le.c <<'//GO.SYSIN DD libF77/hl_le.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-shortlogical hl_le(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-shortlogical hl_le(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) <= 0);-}//GO.SYSIN DD libF77/hl_le.cecho libF77/hl_lt.c 1>&2sed >libF77/hl_lt.c <<'//GO.SYSIN DD libF77/hl_lt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-shortlogical hl_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-shortlogical hl_lt(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) < 0);-}//GO.SYSIN DD libF77/hl_lt.cecho libF77/i_abs.c 1>&2sed >libF77/i_abs.c <<'//GO.SYSIN DD libF77/i_abs.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_abs(x) integer *x;-#else-integer i_abs(integer *x)-#endif-{-if(*x >= 0)-	return(*x);-return(- *x);-}//GO.SYSIN DD libF77/i_abs.cecho libF77/i_dim.c 1>&2sed >libF77/i_dim.c <<'//GO.SYSIN DD libF77/i_dim.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_dim(a,b) integer *a, *b;-#else-integer i_dim(integer *a, integer *b)-#endif-{-return( *a > *b ? *a - *b : 0);-}//GO.SYSIN DD libF77/i_dim.cecho libF77/i_dnnt.c 1>&2sed >libF77/i_dnnt.c <<'//GO.SYSIN DD libF77/i_dnnt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-double floor();-integer i_dnnt(x) doublereal *x;-#else-#undef abs-#include "math.h"-integer i_dnnt(doublereal *x)-#endif-{-return( (*x)>=0 ?-	floor(*x + .5) : -floor(.5 - *x) );-}//GO.SYSIN DD libF77/i_dnnt.cecho libF77/i_indx.c 1>&2sed >libF77/i_indx.c <<'//GO.SYSIN DD libF77/i_indx.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_indx(a, b, la, lb) char *a, *b; ftnlen la, lb;-#else-integer i_indx(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-ftnlen 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);-}//GO.SYSIN DD libF77/i_indx.cecho libF77/i_len.c 1>&2sed >libF77/i_len.c <<'//GO.SYSIN DD libF77/i_len.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_len(s, n) char *s; ftnlen n;-#else-integer i_len(char *s, ftnlen n)-#endif-{-return(n);-}//GO.SYSIN DD libF77/i_len.cecho libF77/i_mod.c 1>&2sed >libF77/i_mod.c <<'//GO.SYSIN DD libF77/i_mod.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_mod(a,b) integer *a, *b;-#else-integer i_mod(integer *a, integer *b)-#endif-{-return( *a % *b);-}//GO.SYSIN DD libF77/i_mod.cecho libF77/i_nint.c 1>&2sed >libF77/i_nint.c <<'//GO.SYSIN DD libF77/i_nint.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-double floor();-integer i_nint(x) real *x;-#else-#undef abs-#include "math.h"-integer i_nint(real *x)-#endif-{-return( (*x)>=0 ?-	floor(*x + .5) : -floor(.5 - *x) );-}//GO.SYSIN DD libF77/i_nint.cecho libF77/i_sign.c 1>&2sed >libF77/i_sign.c <<'//GO.SYSIN DD libF77/i_sign.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-integer i_sign(a,b) integer *a, *b;-#else-integer i_sign(integer *a, integer *b)-#endif-{-integer x;-x = (*a >= 0 ? *a : - *a);-return( *b >= 0 ? x : -x);-}//GO.SYSIN DD libF77/i_sign.cecho libF77/iargc_.c 1>&2sed >libF77/iargc_.c <<'//GO.SYSIN DD libF77/iargc_.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-ftnint iargc_()-#else-ftnint iargc_(void)-#endif-{-extern int xargc;-return ( xargc - 1 );-}//GO.SYSIN DD libF77/iargc_.cecho libF77/l_ge.c 1>&2sed >libF77/l_ge.c <<'//GO.SYSIN DD libF77/l_ge.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-logical l_ge(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-logical l_ge(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) >= 0);-}//GO.SYSIN DD libF77/l_ge.cecho libF77/l_gt.c 1>&2sed >libF77/l_gt.c <<'//GO.SYSIN DD libF77/l_gt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-logical l_gt(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-logical l_gt(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) > 0);-}//GO.SYSIN DD libF77/l_gt.cecho libF77/l_le.c 1>&2sed >libF77/l_le.c <<'//GO.SYSIN DD libF77/l_le.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-logical l_le(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-logical l_le(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) <= 0);-}//GO.SYSIN DD libF77/l_le.cecho libF77/l_lt.c 1>&2sed >libF77/l_lt.c <<'//GO.SYSIN DD libF77/l_lt.c' 's/^-//'-#include "f2c.h"--#ifdef KR_headers-extern integer s_cmp();-logical l_lt(a,b,la,lb) char *a, *b; ftnlen la, lb;-#else-extern integer s_cmp(char *, char *, ftnlen, ftnlen);-logical l_lt(char *a, char *b, ftnlen la, ftnlen lb)-#endif-{-return(s_cmp(a,b,la,lb) < 0);-}//GO.SYSIN DD libF77/l_lt.cecho libF77/main.c 1>&2sed >libF77/main.c <<'//GO.SYSIN DD libF77/main.c' 's/^-//'-/* STARTUP PROCEDURE FOR UNIX FORTRAN PROGRAMS */--#include "stdio.h"-#include "signal.h"--#ifndef SIGIOT-#ifdef SIGABRT-#define SIGIOT SIGABRT-#endif-#endif--#ifndef KR_headers-#include "stdlib.h"-#endif-#ifdef __cplusplus-extern "C" {-#endif--#ifdef NO__STDC-#define ONEXIT onexit-extern void f_exit();-#else-#ifndef KR_headers-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--#ifdef KR_headers-extern void f_init(), sig_die();-extern int MAIN__();-#define Int /* int */-#else-extern void f_init(void), sig_die(char*, int);-extern int MAIN__(void);-#define Int int-#endif--static void sigfdie(Int n)-{-sig_die("Floating Exception", 1);-}---static void sigidie(Int n)-{-sig_die("IOT Trap", 1);-}--#ifdef SIGQUIT-static void sigqdie(Int n)-{-sig_die("Quit signal", 1);-}-#endif---static void sigindie(Int n)-{-sig_die("Interrupt", 0);-}--static void sigtdie(Int n)-{-sig_die("Killed", 0);-}--#ifdef SIGTRAP-static void sigtrdie(Int n)-{-sig_die("Trace trap", 1);-}-#endif---int xargc;-char **xargv;--#ifdef KR_headers-main(argc, argv) int argc; char **argv;-#else-main(int argc, char **argv)-#endif-{-xargc = argc;-xargv = argv;-signal(SIGFPE, sigfdie);	/* ignore underflow, enable overflow */-#ifdef SIGIOT-signal(SIGIOT, sigidie);-#endif-#ifdef SIGTRAP-signal(SIGTRAP, sigtrdie);-#endif-#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 */-return 0;	/* For compilers that complain of missing return values; */-		/* others will complain that this is unreachable code. */-}-#ifdef __cplusplus-	}-#endif//GO.SYSIN DD libF77/main.cecho libF77/makefile 1>&2sed >libF77/makefile <<'//GO.SYSIN DD libF77/makefile' 's/^-//'-.SUFFIXES: .c .o-CC = cc-SHELL = /bin/sh-CFLAGS = -O--# If your system lacks onexit() and you are not using an-# ANSI C compiler, then you should add -DNO_ONEXIT to CFLAGS,-# e.g., by changing the above "CFLAGS =" line to-# CFLAGS = -O -DNO_ONEXIT--# On at least some Sun systems, it is more appropriate to change the-# "CFLAGS =" line to-# CFLAGS = -O -Donexit=on_exit--# compile, then strip unnecessary symbols-.c.o:-	$(CC) -c -DSkip_f2c_Undefs $(CFLAGS) $*.c-	ld -r -x -o $*.xxx $*.o-	mv $*.xxx $*.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--# To compile with C++, first "make f2c.h"-f2c.h: f2ch.add-	cat /usr/include/f2c.h f2ch.add >f2c.h--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 f2ch.add \-	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_qq.c pow_ri.c \

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -