The compiler we have is:
pgf90 6.1-4 32-bit target on x86-64 Linux
Copyright 1989-2000, The Portland Group, Inc. All Rights Reserved.
Copyright 2000-2006, STMicroelectronics, Inc. All Rights Reserved.
When I do pgf90 -c libsample.f90 on the following code,
I get no problems with the compiler. In this code I declare
three public variables CoarsGrid, MesoGrid and FineGrid. The user-defined
type SampleType is defined as private and therefore no module or program that will use LibSample will know what to do with the Sample-component of the three global variables. I would have liked a warning/error message from the compiler like:
“TYPE(SampleType), DIMENSION(:,:), ALLOCATABLE :: Sample
Component Sample of SampleGridType will be invisible to
other units. Type SampleType is declared as private to this module.”
Maybe the compiler hopes that I will define SampleType in another module,
just like GridSpecsType, LocalMeteoGridType, Float and NuclideVector. Still, the fact that SampleGridType has a locally consistent, private meaning to this module should have triggered an alarm about its use outside the module.
! Principally everything is LOCAL...
! ... except for the following:
PUBLIC :: SampleGridType,CoarseGrid,MesoGrid,FineGrid
TYPE(NuclideVector) :: Con,MomDep,Dep,ICon,IDep
END TYPE SampleType
INTEGER :: CoordinateSystem
TYPE(GridSpecsType) :: GridSpecs
REAL(Float) :: z
TYPE(LocalMeteoGridType) :: Meteo
TYPE(SampleType), DIMENSION(:,:), ALLOCATABLE :: Sample
END TYPE SampleGridType
TYPE(SampleGridType) :: CoarseGrid,MesoGrid,FineGrid
END MODULE LibSample