# Tagged Questions

Questions about interfacing Mathematica and Fortran. This also includes conversion of Fortran style numbers to Mathematica style.

2k views

FORTRAN code can be called using MathLink or .NET/Link (see the link for a worked examples). But as mentioned in a talk by T.Gayley and J.Klein in Wolfram Technology Conference 2011, LibraryLink, ...
2k views

### How can I get Mathematica to produce better Fortran code?

I am new to Mathematica and I am trying to get to it to produce some expressions in Fortran code. However, it seems that Mathematica will output duplicated expressions, that is, expressions the need ...
1k views

### How to change an expression to Fortran90 form?

I have a large expression produced by Mathematica. To use this expression in my Fortran program I need to change it to a Fortran90 form. I am not satisfied with the ...
513 views

First, the main reference is the thread Linking FORTRAN with Librarylink, which teaches how to make the link between a FORTRAN subroutine and a Mathematica code, by using Librarylink. This must done ...
7k views

### How to export data files using specific format

Very often, I have to export data files from Mathematica. These output files contain several columns and hundreds of lines with data. For the sake of the question let's create a sample list ...
162 views

### Where is f2mma.zip, Fortran to Mathematica converter?

I want to convert the SOFA libraries to Mathematica, and found out about f2mma, a Fortran to Mathematica converter. Google points to many papers about f2mma, but the only link to the software ...
455 views

### How to create FORTRAN Cell?

I want to create a FORTRAN cell in Mathematica. ...
85 views

### Customized FortranForm output

Let's take the following example V = (-G*Mn)/Sqrt[x^2 + y^2 + z^2 + cn^2]; Vx = D[V, x]; FortranForm[Vx] The result is ...
181 views

### Output most efficient Fortran code by mathematica

I am trying to output most efficient Fortran code by mathematica 9.0 with the method Simon provided: How can I get Mathematica to produce better Fortran code? The expressions is as follows: ...
354 views

### Using FortranForm for d0 notation? [duplicate]

When I use FortranForm, it changes 2*a^2 into 2*a**2 which is fine, but if I want the expression in a form such as, 2.d0*a**2 which represents an integer to be ...
45 views

### weird behaviour of Listable fortran Librarylink function: different result each evaluation

I am working with fotran librarylink function currently. In this post, I will show some weird result of Listable fortran librarylink generated by intel compiler under windows (I tried gcc on linux the ...
246 views

### Using FortranForm

I need to use in Fortran, matrices that I create in Mathematica, therefore, I need to format them, so that Fortan can understand them. I focus on the simplest example: Let's say I have tha matrix A ...
189 views

...
133 views

### ToExpression and Fortran notation

ToExpression["9.0E-03"] interprets the string as 9*e - 3 instead of what I am expecting: ...
219 views

### What is the equivalent of FORTRAN 77 COMMON BLOCK in Mathematica?

I am in the process of converting a FORTRAN 77 program to Wolfram Language. I have several COMMON BLOCK statements in FORTRAN 77. My question is how to deal with them in Wolfram Language? My ...
153 views

### How to get output in a specified format

In Fortran, we can easily get the stardard and easy output format. Now, we only focus on the Integer output. See here How to realize this kind of output as formatted text file using Mathematica ? (...
158 views

### Insert a linebreak and character repeatedly into a matrix output which is in fortranForm

Suppose I have a very long string which is a11 element of matrix a11=2*gopsv-2*Bgopsvw+2*acgmops*v+2*cgmopsv*B-2*acgmopsvB+3*gmopsvB-3*BgmopsvwB+m*w2*B +5*acgm2 +opsvB -ac*m2*w2*B +cgm2*opsvB* - 3*...
77 views

### Using .Net link with fortran DLL created by Intel Fortran [closed]

I am following unstable's wonderful answer on .NET and fortran. I can reproduce his result using gfortran without problem. But I want to use Intel Fortran, because gfortran generates slower code on ...
46 views

### How to show Output of matrix in FortranForm with “&” character?

I have a matrix. and i have shown the output of matrix one by one element in FortranForm. the problem is i want to put "&" continuation charater in output because when i am copying the data into ...
401 views

### Latest Mathematica 9.0 can't use Format.m to generate optimized Fortran code [closed]

Before updating to Mathematica 9.0, I have successfully generated beautiful Fortran code using Mark Sofroniou's Format.m package, which is posted on MathSource. ...
677 views

### Formatting Fortran complex number output for use in Mathematica

Here is a list that was orignially output from Fortran. {{"(0.277336296055697, 0.120000000000000E+000)"}, {"(-1.489297392708939E-002, 0.340000000000000E+000)"}} ...
99 views

### How to show output of a matrix in m(1,1)=a11 m(1,2)=a12 …in this way…i have 50 *50 size matrix

How to show output of a matrix in m(1,1)=a11 m(1,2)=a12 ...in this way......i have 50 *50 size matrix so i want to do it efficiently. output to be shown like m(1,1)=a11 (in fortranForm) m(1,2)=a12 ...