I have a derived-type with pointer (or allocatable) component And I want to create a parameter, e.g. to pass it to a subroutine as intent(in): C ...
I have a derived-type with pointer (or allocatable) component And I want to create a parameter, e.g. to pass it to a subroutine as intent(in): C ...
I have two programs : 2D and 3D versions. For example, this is a simplified 2D version : And the 3D version, These programs are very similar and ...
I read on many posts on Stack Overflow that an allocatable array is deallocated when it is passed in a subroutine where the dummy argument is intent(o ...
When a situation such as described in Incorrect fortran errors: allocatable array is already allocated; DEALLOCATE points to an array that cannot be d ...
Now I have one 1024 * 1024 * 1024 array, whose dtype is float32. Firstly I save this array to one file in the format of '.bigfile'. And then I convert ...
I wish to create jagged arrays in Fortran with multiple levels of allocation. However I run in to the error of "There is no specific subroutine for th ...
I'm trying to build an allocatable array with polymorphic elements. A minimal example is the following : Now, the code above works fine and prints ...
This doesn't work The code above automatically allocates B and copies A(:,:,1) to B. However it doesn't keep the lower/upper bound of 0/ny, instead ...
Let me consider a function returning an allocatable array. Should the array variable holding the result (outside the function) be allocated before an ...
I would like to know why this code returns error in the last print. With gfortran 7.4.0 fails but with ifort 18.0.3 works well. The gfortran error ...
I would like to know whether it is possible in modern Fortran to assign an allocatable array using itself, or part of it, to do it. Here it is a simpl ...
I have a fortran program that has the structure given below. This program has been crashing with 'Segmentation fault' error, so I did a lot of digging ...
I'm looking for a way to build a tree structure using a User-Defined Type in Fortran 2008. While I can get some basic code working, I'm encountering m ...
In the project I'm working on, I find myself frequently needing to resize arrays of objects as new objects are created and old ones destroyed. This ha ...
I have the following module with an allocatable variable which is defined in the module, allocated in a subroutine, and then also used in a second sub ...
When allocating zero-sized arrays in Fortran, I am getting counterintuitive behavior. This code: Produces the following output: Is my compile ...
Since Fortran 2003 is it possible to work with variable length character strings. Instead of working in an archaic way and declaring a constant string ...
I'm doing an assignment for a class where we need to write a program using allocatable arrays to hold an arbitrary number of x and y data pairs, alloc ...
I make huge use of non-1 indexed ALLOCATABLE arrays, whose actual lower (and thus upper) bounds I want to be known for the procedures they're given to ...
I'm struggling with some Modern Fortran wrappers to some MPI scatter/gather routines. I am trying to have a wrapper interface that only has an array o ...