Questions tagged [fortran]

Fortran is a long-lived programming language for scientific computing

Filter by
Sorted by
Tagged with
5 votes
0 answers
201 views

Fortran-Python Interface

Disclaimers: This question is reposted from SO upon SO user's suggestion to put it here since there is no specific code in question. This question is a subset of my larger theme of Fortran ...
user avatar
  • 325
4 votes
0 answers
143 views

Global variables and common block management in Fortran

Background The high level overview of my situation is described here. I am breaking it apart into smaller, specific questions, such as this one, regarding extensive use of global variables in a ...
user avatar
  • 325
5 votes
1 answer
504 views

How to modernize large legacy Fortran program? [duplicate]

Problem Background Recently, I joined a government agency as a software engineer/scientist/analyst. Previously, worked in software industry - gained 3 years of software engineering experience at ...
user avatar
  • 325
0 votes
1 answer
115 views

Time profiling - is using macros bad?

I need to make a time profiling for several modules in Fortran, which means, that I'm supposed to write the same code in every beginning and every end of every function. Really, it looks like this: ...
user avatar
  • 327
1 vote
1 answer
264 views

Good design for modular computational physics code in Fortran

I'm currently working on a computational physics code in Fortran. In summary, the code performs the following operations: Initialize Loop until done Advance solution over time Possibly write output ...
user avatar
0 votes
1 answer
174 views

Handling linear interpolation of periodic functions

I have a periodic functions and I have the values of this function at discrete points. So I have: f(t_i) for some t_i, i\el(0,n) Now between these discrete points I want to lineary interpolate the ...
user avatar
  • 101
1 vote
1 answer
120 views

Distributing Fortran bindings for a project written in another language

I'm writing the Fortran bindings for a static library written in C++. This will be distributed with the library (both open source). The bindings consist of modules containing interface blocks and no ...
user avatar
  • 111
2 votes
2 answers
502 views

Private variables and the old FORTRAN common blocks [closed]

This is a question that perplexes me about object oriented programming. In some OOP languages (e.g. C++) a member function can access private variables of the class without restriction. That means ...
user avatar
3 votes
1 answer
251 views

Approach for polyglot logging

I'm building a desktop app with a Java front-end and very performance critical Fortran libraries. We've recently started pushing more of our code out of Java and into Fortran (see below) Soon we will ...
user avatar
  • 239
-1 votes
1 answer
342 views

How to run a Fortran code more than 10^9 times in ftn95? [closed]

I need to run a Fortran code more than 10^9 times in ftn95. When I try to run my code more than 10^9 times it gives a error message "this loop will never be executed". In a book I read that if we ...
user avatar
7 votes
2 answers
5k views

Using subroutines to return values?

I'm currently learning FORTRAN (I am familiar with MatLab) and I am very confused about the point of subroutines. Why would anyone use them as opposed to functions. Also, how is it that they can ...
user avatar
7 votes
5 answers
6k views

Why was Fortran never used to develop an Operating System?

I'm not a Fortran developer myself, but I'm about to use it a little and found myself wondering why, if it is much older than C but equally as performant as C, was it never used to develop any ...
user avatar
  • 217
25 votes
3 answers
5k views

"Ever change the value of 4?" - how did this come into Hayes-Thomas quiz?

In 1989 Felix Lee, John Hayes and Angela Thomas wrote a Hacker's test taking the form of a quiz with many insider jokes, as “Do you eat slime-molds?” I am considering the following series: 0015 Ever ...
user avatar
0 votes
2 answers
141 views

Arrays' subscripts priority

I was reading a lecture on arrays for Fortran 90 and I came across this sentence : 'Fortran always stores by columns - the first subscript varies more rapidly than the second, and so on.' What does ...
user avatar
  • 111
0 votes
1 answer
7k views

Identity matrix using Fortran 95

The following code give the identity matrix of any size the user wish it to be: program identitymatrix real, dimension(:, :), allocatable :: I character:: fmt*8 integer :: ms, j print*,'the ...
user avatar
  • 111
-2 votes
2 answers
2k views

Fortran 90 - How to create a coordinate system

So I need to code a simple program, and I need to define 2D coordinates? Is there any coordinate system I can use in Fortran? I was told it might have to be all in arrays? And if so, can anybody ...
user avatar
0 votes
3 answers
2k views

Why we say Lisp are Human oriented and Fortran are Machine oriented? [closed]

Lisp and Fortran were the trunks of two separate evolutionary trees, one rooted in math and one rooted in machine architecture. I see this in Hackers and Painters: Big Ideas from the Computer ...
user avatar
  • 29
6 votes
2 answers
3k views

How can I combine C/Fortran with JavaScript?

I'm working on a project where I need heavy numerical calculations to be real-time visualized with something flexible like D3.js. Are there frameworks out there that would let me painlessly achieve ...
user avatar
  • 63
11 votes
12 answers
3k views

How can I explain object-oriented programming to someone who's only coded in Fortran 77?

My mother did her college thesis in Fortran, and now (over a decade later) needs to learn c++ for fluids simulations. She is able to understand all of the procedural programming, but no matter how ...
user avatar
13 votes
9 answers
6k views

Greenspun's Tenth Rule, does every large project include a Lisp interpreter? [closed]

Greenspun's tenth rule (actually the only rule) states that: Any sufficiently complicated C or Fortran program contains an ad hoc, informally-specified, bug-ridden, slow implementation of half of ...
user avatar
14 votes
10 answers
7k views

Converting Fortran 77 code to C#

I'm trying to convert a Fortan77 program to C#. I have a subroutine with about 650 lines of code and horrific GOTO statements all over the place. I'm having a lot of trouble even starting to visualise ...
user avatar
5 votes
7 answers
3k views

What keywords are important to speedup the code in C++?

I'm porting to C++ and adding a lot of functionality to a numerical application written in Fortran 77. While I hate F77, I have to admit that the thing goes very fast. Now, I'm implementing ...
user avatar
  • 1,162
22 votes
7 answers
2k views

How can a large, Fortran-based number crunching codebase be modernized?

A friend in academia asked me for advice (I'm a C# business application developer). He has a legacy codebase which he wrote in Fortran in the medical imaging field. It does a huge amount of number ...
user avatar
0 votes
4 answers
333 views

Design of an evaluator object for propagation and IO of results

We are having a discussion about design. Keep into account this is fortran, so we can't be too smart. We have the following classes: Application, System, Calculator, CalculatorSimple, ...
user avatar
18 votes
6 answers
5k views

Do Fortran compilers really generate faster code than C compilers?

When I was studying in the university I often heard the idea that Fortran compilers produced faster code than C compilers for an equivalent program. The key reasoning went like this: a Fortran ...
user avatar
  • 4,309
9 votes
5 answers
2k views

Why is there no Fortran standard library?

To be a language focused on mathematics and scientific computing, I am always baffled by the total lack of useful mathematical routines in the Fortran standard library. One would expect it to be ...
user avatar