Hassan:
In ddsim.ins, RECORD is a type, not an object, just as INTEGER is a
type, not an object. Just below the line "END TYPE RECORD" you could
add a line saying "TYPE (RECORD) :: RECORD", which would create an
object, RECORD, of type RECORD. (I suggest using different names,
such as RECORD and RECORD_TYPE.)
-jack
=======================================================================
Dear Fortraners,
As a neophyte to Fortran 90, I would appreciate if you could
enlighten me on the following problem.
I want to declare a derived type. The following doesn't work.
What am I doing wrong?
=============== In a file called ddsim.ins ===========
type record
integer*4 aid
integer*4 sid
integer*4 did
real, dimension(:), pointer :: gpar
end type record
common / xxx / record
=================In the main program ===================
SUBROUTINE YYYYY
include 'ddsim.ins'
allocate(gpar(36))
do i=1,5
record%aid=i
record%sid=0
record%did=0
do j=1,36
record%gpar(j) = 99.0
enddo
write(*,*) record
END SUBROUTINE YYYYY
Best Regards,
Hassan
--
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|