您可以将模块假定为PRIVATE或假定为PUBLIC . 我将展示PRIVATE .
module DataTypeModule
implicit none
PRIVATE !
type :: DatCube_Struct
integer :: nGrid
double precision, allocatable, DIMENSION(:) :: tgrid
end type DatCube_Struct
!PUBLIC DatCube_Struct !(Only needs to be public if you want to use it in separate from DataCube)
type(DatCube_Struct), DIMENSION(4) , PUBLIC :: DataCube !
double precision, DIMENSION(:,:), ALLOCATABLE, PUBLIC :: tgrd !
!! PUBLIC DataArraySizes, DataTGrd !
PUBLIC ConstructDataCube !
!%%%%%%%%%%%%%%
contains
!%%%%%%%%%%%%%%
!%%%%%%%%%%%%%%
!! subroutine DataArraySizes(NGrd)
subroutine DataArraySizes
implicit none
!!--> integer, intent(out) :: NGrd(4)
open(unit=15, file='./Data/DataHeader.txt', status='old')
read(15,*) NGrd(1)