! I have a problem with meeting both the F restrictions and the
! Fortran90/95 standard at the same time.
!
! The problem is that F requires PRIVATE statements in modules
! USEing other modules. In the following example, doesn't the
! PRIVATE statement in module OUTER give the accessibility PRIVATE
! to INNER_TYPE as well? Then, according to the standard, OUTER_PROC
! must not be public (which is very unfortunate, of course ...).
module inner
type, public :: inner_type
integer :: i
end type inner_type
end module inner
module outer
use inner
private ! required by F
public :: outer_proc
contains
subroutine outer_proc (inner_arg)
type(inner_type), intent(in) :: inner_arg
print *, inner_arg%i
end subroutine outer_proc
end module outer
! Both the F compiler and NAG's f95 accept the code, but I have one
! user for whom a version of SUN f90 rejected the module (or rather,
! the real world version of it). The IRIX f90 appears to accept the
! code as well.
!
! Questions:
!
! 1) is this really a bug in the NAG compiler or is the SUN
! compiler at fault (at first, I thought the latter, but
! after reading the standard, I'm leaning towards the first)?
!
! 2) what is the proper idiom in F for procedures with arguments
! of a deried type define in a USEd module?
!
! Thanks,
! -Thorsten
--
Thorsten Ohl, Physics Department, TU Darmstadt -- [log in to unmask]
http://crunch.ikp.physik.tu-darmstadt.de/~ohl/ [<=== PGP public key here]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|