Hi,
I have a case where compilers disagree.
In the example below, is typ%in a whole array, in which case its bounds
should be (0,4), or an array section, in which case its bounds should be
(1,5). Same question about pt_1. I see both interpretations, with
different compilers. Some compilers even interpret typ%in and pt_1
differently, which adds to my confusion.
Thanks
Bertrand
!------------------------------------------------------------------
program type_array_section
type der_type
real x
integer :: in
end type der_type
type(der_type), dimension(0:4), target :: typ
integer , dimension(:) , pointer :: pt_1
typ%in = 45
typ%x = 3.
pt_1 => typ%in
print *,' lbound(typ%in), ubound(typ%in) ', lbound(typ%in),ubound(typ%in)
print *,' lbound(pt_1), ubound(pt_1) ', lbound(pt_1),ubound(pt_1)
end program type_array_section
!------------------------------------------------------------------
Bertrand Meltz
Commissariat a lŽEnergie Atomique | e-mail : [log in to unmask]
CEA / DIF , BP 12 | Tel : (33) [0] 1 69 26 57 83
91680 Bruyeres-le-Chatel , FRANCE | Fax : (33) [0] 1 69 26 70 93
|