The error is not in the compilers but rather that the common block is in
a module.
To access it you must have a "use" clause in the main code.
I.e.
PROGRAM MAIN
use INITT

Then you don't even have to define the common block in main.

The "EXTERNAL INITT" does nothing in this case, it just says that the
function/subroutine initt is external, but there is no such
function/subroutine and it isn't used either (obviously).


I.e., the correct main_prob.f must in this case be called main_prob.f90
(since it is F90 not F77 code or you have to explicitly tell the
compiler that it is dealing with f90 or at least freeform fortran code)
And should look like

PROGRAM MAIN
use initt

PRINT *,'A =', IA
PRINT *,'B =', IB

END

And of course initt_probe should also be called .f90 since it is F90 not
F77 code.

On 02/15/2018 10:10 PM, Balazs HAJGATO wrote:
> Dear Easybuilders,
> 
> I have some problems with fortran linking. It looks that certain versions of 
> fortran does not look for external block data in libraries. If one specifies 
> the object file for the block data then the result is correct. 
> 
> It seems that gfortran <= 4.8 works correctly, but gfortran >=4.9 not works 
> correctly in some cases. 

-- 
Ake Sandgren, HPC2N, Umea University, S-90187 Umea, Sweden
Internet: [email protected]   Phone: +46 90 7866134 Fax: +46 90-580 14
Mobile: +46 70 7716134 WWW: http://www.hpc2n.umu.se

Reply via email to