fortran

Do we still need subroutines ?

In Fortran, a clear difference exists between function and subroutine: functions return one value, subroutines return no value. This introduce a cascade of differences between the two. One example is the calling semantics: you can call a function just as in other languages, but in order to call a subroutine you must issue a call statemen...

Can I have a pointer to an item in an allocatable array?

I have a user-defined type vector. In another type, I have an allocatable array of vectors. I want to have a pointer to a single vector from this allocatable array. So I thought I would do this: type(vector),allocatable,target::my_vectors(:) and type(vector),pointer::pointed_vec But when I compile, the compiler complains that: Thi...

routine name length in fortran90

Hi Does anyone know if there is a maximum length for routine name and variable name in fortran 90 ? many thanks ...

Why is this a function declared inside the module and then used somewhere else in the same module not seen by the linker?

I have a function (in case anyone is interested, it is this function) in a module that looks like this MODULE MYMODULE IMPLICIT NONE ! Some random stuff CONTAINS CHARACTER*255 FUNCTION strtok ( source_string, delimiters ) [...] END FUNCTION strtok SUBROUTINE DO_SOMETHING ( ) CHA...

Why do I get missing DLL errors debugging my Fortran code using GDB on Windows 7 64-bit (using Eclipse/Photran/Cygwin)?

My setup is as follows: OS: Windows 7 Home Premium 64-bit Eclipse: Helios 3.6.1 64-bit with CDT and Photran Java SE Runtime Environment: 1.6.0_21 Java Hotspot: 64-bit Server VM (build 17.0-b17, mixed mode) Cygwin 1.7.2 (32-bit) My initial test Fortran application simply prints 'Hello World!' and exits. The code builds and runs fin...

Compiler validation suite for Fortran 2003?

Is there a test suite out there that checks whether a Fortran compiler fully implements the Fortran 2003 standard? ...

"Real world" use of parameter passing in Fortran

I always assumed that fortran passed entities "by reference" to a dummy argument. Then I got this answer (the actual argument of the answer was related, but not on this) The standard never specifies that and, indeed goes quite a lot out of its way to avoid such specification. Although yours is a common misconception, it was n...

Emacs and intel debugger

Hi, A coworke integrated the gdb into my emacs, so that i can single step through my code and it gets shown where i am in the emacs window. How do i do that with idb? Unfortunately i cannot remember what we did then, so a walkthrough would be appreciated. cheers ...

How do I get my executable's location using Fortran?

Hi everyone, I have a program written in Fortran 90/95; after invocation it always reads a certain data file. For the users' convenience I'd like them to just have to place this file in the same directory as the executable itself, without making them set some environment variable/extend $PATH, and without forcing them to use a certain d...

difference between POINTER and ALLOCATABLE

what is the difference between these two codes type Foo real, allocatable :: bar(:) end type and type Foo real, pointer :: bar(:) end type in particular when it comes to the following code: type(Foo) :: myfoo allocate(myfoo%bar(10)) ...

converting a Peng Robinson equation code in fortran to C++

i would like someone to assist in converting this code to C++ c ---------------------------------------------------------------------- c Calculate pressure based on the generalized Peng-Robinson equation of state. c for water. c Variables Used ... c T ... temperature (K) c P ... vapor pressure (MPa) c V ... volume (m^3/kmol) c ---...

Parsing FORTRAN output files using Java

Are there any Open Source Java tools for parsing FORTRAN output? I'd like to be able to write something like Format format = new Format("(1x, 2(F10.3,I3,' XY ',F7.3))"); String s = " -12345.897 XY 123.456-12345.897*** XY 123.456"; Result result = format.parse(s); Note that it's specifically FORTRAN. Note the fun things like conc...