Skip to content

Commit ae2814e

Browse files
FoadsfFoadsf
authored andcommitted
new fortran C mixed programing examples added and binary files removed
1 parent f833803 commit ae2814e

File tree

105 files changed

+4511
-27230
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+4511
-27230
lines changed

A_fortran/readme.txt

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,15 @@ mixed language programing
55
call fortran functions/subroutines
66
interface the function calls
77

8-
source:
9-
1. http://www.yolinux.com/TUTORIALS/LinuxTutorialMixingFortranAndC.html
108

119

1210
sources to be looked at:
13-
1. https://msdn.microsoft.com/en-us/library/aa293328(v=vs.60).aspx
14-
2. http://docs.cray.com/books/S-2179-52/html-S-2179-52/ppgzmrwh.html
15-
3. http://arnholm.org/software/cppf77/cppf77.htm
11+
1.
12+
2.
13+
3. http://arnholm.org/software/cppf77/cppf77.htm --> test35
1614
4. http://www.nag.com/lapack-ex/node1.html#sec:Introduction
1715
5. http://physics.oregonstate.edu/~landaur/nacphy/lapack/fortran.html
18-
6. http://www.fortran.com/the-fortran-company-homepage/fortran-tools-libraries-and-application-software/
16+
6. http://www.fortran.com/the-fortran-company-homepage/fortran-tools-libraries-and-application-software/ --> Fortran Tools, Libraries, and Application Software
1917
7. iso_c_binding
2018
8. https://docs.oracle.com/cd/E19059-01/stud.9/817-6694/11_cfort.html
2119
9. https://www.math.utah.edu/software/c-with-fortran.html
@@ -27,6 +25,7 @@ sources to be looked at:
2725
15. http://www.unidata.ucar.edu/software/netcdf/examples/programs/
2826
16. http://people.sc.fsu.edu/~jburkardt/c_src/mixed/mixed.html
2927
17. https://docs.oracle.com/cd/E19422-01/819-3685/11_cfort.html
28+
18. cfortran--> http://www-zeus.desy.de/~burow/cfortran/
3029

3130

3231
points:
@@ -38,3 +37,5 @@ issues:
3837
1. test22 result not correct
3938
2. test19 does not compile
4039
3. test24 not compiling
40+
4. test4 not compiling
41+
5. test34 not compiling

A_fortran/test23/tstfunc1.f

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ subroutine tstfunc()
44
common /test/ delta
55
integer i,j
66
do i = 1, 5
7-
do j = 1, 5
7+
do j = 1, 5
88
if (i.ne.j) then
99
delta(i,j)=0
1010
else

A_fortran/test25/Makefile

Lines changed: 0 additions & 8 deletions
This file was deleted.

A_fortran/test25/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

A_fortran/test26/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

A_fortran/test27/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

A_fortran/test28/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

A_fortran/test29/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

A_fortran/test3/CSUBS.C

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/* File CSUBS.C */
2+
3+
#include <math.h>
4+
5+
int Fact(int n) {
6+
if (n > 1)
7+
return (n * Fact(n - 1));
8+
return 1;
9+
}
10+
11+
void Pythagoras(float a, float b, float *c) { *c = sqrt(a * a + b * b); }

A_fortran/test3/FORMAIN.FOR

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
C File FORMAIN.FOR
2+
C
3+
INTERFACE TO INTEGER*4 FUNCTION Fact [C,ALIAS:'_Fact'] (n)
4+
INTEGER*4 n [VALUE]
5+
END
6+
7+
INTERFACE TO SUBROUTINE Pythagoras [C,ALIAS:'_Pythagoras'] (a,b,c)
8+
REAL*4 a [VALUE]
9+
REAL*4 b [VALUE]
10+
REAL*4 c [REFERENCE]
11+
END
12+
13+
INTEGER*4 Fact
14+
REAL*4 c
15+
WRITE (*,*) 'Factorial of 7 is ', Fact (7)
16+
CALL Pythagoras (30, 40, c)
17+
WRITE (*,*) 'Hypotenuse if sides 30, 40 is ', c
18+
END

0 commit comments

Comments
 (0)