That you for your answer, both showing what I want to do with different methods.
salgerman, you understood my problem welle, I wanted to take on any one-dimensional function. I am just surprised I get a segmentation fault if I do not declare f2 and f5 as allocatables. Anyway, by declaring them...
Comparisons in 'if' statements are made with '==', because '=' is used for assignments. Moreover, when comparing characters, the characters you are comparing to need to be given between quotes ('').
The following example works with my computer (gfortran) :
program main
implicit none...
I had a look on the links you provided, mikrom, but unfortunately they deal with with simple assumed-shape arrays, and not assumed-shape arrays of functions, and are helpless for my case.
Let me sum up my problem, for the readers of the forum.
I have the code given below. In this code, the...
Thank you, this is exactly what I was looking for ! I tried with my own example and it works very well.
One last question : to avoid the use of the function overloading with the general interface, I was wondering if it was possible to define, in the interface for the function passed as argument...
You links seem to contain interesting information.
I will look at them with great attention and come back later to tell if it works for my case.
Thank you !
Thank you for your answers.
Here are my comments to all of your recommendations.
to Salgerman (post #1):
The problem is that I do not to point at a variable, but at a function. Therefore, I cannot declare my pointer with
real*8, pointer :: ap(:)
What I tried to do is to use the following...
Hello everybody,
I am starting this thread because I encounter a problem with the pointers in Fortran.
I want to use a pointer of an array-valued function, but I get a segmentation fault error during execution (compilation is ok with gfortran).
Everything works well when the pointer aims at a...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.