- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
I compile the following code in fortran 2011 on windows, there is no error in compilation
but I don't get array c( the result page is blank). I am using the allocatable array feature of Fortarn 2003.My source code is in ".f90" .
program bob
implicit none
real,dimension(2,2)::a=reshape((/2.,3.5,5.,65.236/),(/2,2/))
real , dimension(2,2) :: b=reshape((/5.,2.32,9.,5.5/),(/2,2/))
real , dimension(:,:),allocatable :: c
c = a+b
write(*,*) c
end program bob
I compile the following code in fortran 2011 on windows, there is no error in compilation
but I don't get array c( the result page is blank). I am using the allocatable array feature of Fortarn 2003.My source code is in ".f90" .
program bob
implicit none
real,dimension(2,2)::a=reshape((/2.,3.5,5.,65.236/),(/2,2/))
real , dimension(2,2) :: b=reshape((/5.,2.32,9.,5.5/),(/2,2/))
real , dimension(:,:),allocatable :: c
c = a+b
write(*,*) c
end program bob
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
By default, the compiler does not support the automatic reallocation on assignment of allocatable arrays. Add the /standard-semantics option to get all Fortran 2003 semantics including this one. If in Visual Studio, this is a property on the Language page.

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page