Is it possible (or even wise) to “encapsulate” constants from a module for use in a USE : ONLY statement?
Below is the framework of my module source. I know how to do a “use : only” to draw in functions and subroutines from it as needed. What I don’t know how to do is code the module so that I could draw in only the two constants at the top with a USE and ignore the functions and subroutines, should I wish to do so. Is there a source construct for doing this? (Using gfortran, if that makes a difference.)
Is it possible (or even wise) to “encapsulate” constants from a module for use in a USE : ONLY statement?
Below is the framework of my module source. I know how to do a “use : only” to draw in functions and subroutines from it as needed. What I don’t know how to do is code the module so that I could draw in only the two constants at the top with a USE and ignore the functions and subroutines, should I wish to do so. Is there a source construct for doing this? (Using gfortran, if that makes a difference.)
Is it possible (or even wise) to “encapsulate” constants from a module for use in a USE : ONLY statement?
Below is the framework of my module source. I know how to do a “use : only” to draw in functions and subroutines from it as needed. What I don’t know how to do is code the module so that I could draw in only the two constants at the top with a USE and ignore the functions and subroutines, should I wish to do so. Is there a source construct for doing this? (Using gfortran, if that makes a difference.)
gfortran handling of submodules
When I compile the following code:
Successful pointer association with data object without target attribute through subroutine
Recently I noticed that it is possible to associate a pointer with a data object without the target attribute through the use of a subroutine. I tested this with a 4×4 array arr
by associating ptr_to_arr => arr
and then by performing subtraction arr-ptr_to_arr
, which yielded 0.0
everywhere.
What would be the right approach to compile this FORTRAN code from 1993?
I have a 31 year old FORTRAN code which I want to compile on a Linux system. Specifically, the system is a CentOS.
Default value for components of Fortran parameterized derived types
Here is a minimal program to reproduce my problem:
Problem with passing a function (or procedure) as argument for another function
I’ve a simple fortran script that finds roots of a function in an interval [a,b] using the function “zbrent”. This is a simple example looking for roots for y=x^2 – 2 between [0,2].