Category "fortran"

How can I call python code from a FORTRAN Code?

I have written a python code for modeling a structure in Abaqus. I have checked it by abaqus cae noGUI=mycode.py in command window (That's how Abaqus is called

How to avoid declaring and setting the value of a variable in each subroutine?

How to avoid repeated declaration of a variable that has a constant value in subroutines? For example: program test implicit none integer :: n integer ::

Data alignment inside a structure in Intel Fortran

I'm trying to align in memory the following type of data: type foo real, allocatable, dimension(:) :: bar1, bar2 !dir$ attributes align:64 :: bar1 !di

Error: "The leftmost part-ref in a data-ref can not be a function reference."

I am trying to write a FORTRAN subroutine for ABAQUS that would modify the seepage coefficient and thus the flow depending on whether there is contact on the su

Passing allocatable array into a subroutine

I am working on a f90 code that I didn't write. I am not a very experienced fortran user. There is a part that bothers me a bit and I am not sure if it is a nor

Python ctypes pass pointer in structure field to Fortran derived types

I want to make a variable-size array to pass to a Fortran DLL and get the result (by reference), so that I can get value directly. In the Fortran code, I use a

f2py compilation error with type(c_ptr) from iso_c_binding

Summary I am trying to write a model using Fortran and I need to use a function to integrate (closed limits). I tried working with fgsl and the standalone scrip

Difference between Fortran's "abstract" and "normal" interfaces

I'm trying to understand the difference between abstract interfaces and "normal" interfaces. What makes an interface abstract? When is each one necessary? Supp

How to find NaN in an array and stop once found?

Say, I want a routine to stop once a not-a-number is found in an array. How can I do this? if (array(i) .eq. NA) ... seems not work. The array is an array of fl

f2py does not properly import, despite successfully compiling

I am successfully compiling my Fortran subroutine with f2py. However, a folder is created as well as a pyd file. If I do not put the created pyd file in the g