小弟我自定义了若干数据类型,都写在module里面,但是在声明的时候很奇怪,第一个数据类型,也就是TYPE Coordinates 声明无误,但是第二个TYPE Matrix_2X2就不能声明,编译器报错,显示出现非预期的数据声明,出错语句用红色标出,求教~[Fortran] 纯文本查看 复制代码
!====TYPE DEFINE!
MODULE DATATYPE
IMPLICIT NONE
TYPE COORDINATES
REAL :: X
REAL :: Y
END TYPE COORDINATES
TYPE MATRIX_2X2
REAL :: LOCAL(2,2)
END TYPE MATRIX_2X2
TYPE B_MATRIX
REAL :: LOCAL(18,3)
END TYPE B_MATRIX
END MODULE DATATYPE
PROGRAM PERSONALPROJECT
USE DATATYPE
TYPE (COORDINATES),DIMENSION(9) :: NODE_COORD
INTEGER :: I,J,K
TYPE (COORDINATES),DIMENSION(9) :: GAUSS_POINT
DO I=1,3,1
GAUSS_POINT(I)%X=-0.7745966
SELECT CASE(I)
CASE(1)
GAUSS_POINT(I)%Y=-0.7745966
CASE(2)
GAUSS_POINT(I)%Y=0
CASE(3)
GAUSS_POINT(I)%Y=0.7745966
END SELECT
END DO
DO I=1,3,1
GAUSS_POINT(I)%X=0
SELECT CASE(I)
CASE(1)
GAUSS_POINT(I)%Y=-0.7745966
CASE(2)
GAUSS_POINT(I)%Y=0
CASE(3)
GAUSS_POINT(I)%Y=0.7745966
END SELECT
END DO
DO I=1,3,1
GAUSS_POINT(I)%X=0.7745966
SELECT CASE(I)
CASE(1)
GAUSS_POINT(I)%Y=-0.7745966
CASE(2)
GAUSS_POINT(I)%Y=0
CASE(3)
GAUSS_POINT(I)%Y=0.7745966
END SELECT
END DO
!=====ITERATION GAUSS AND JACOBIAN MATRIX
TYPE (MATRIX_2X2), DIMENSION(9) :: JACOBIANMATRIX !// 此处报错
END PROGRAM PERSONALPROJECT
|