Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program main1
- use module1
- implicit none
- integer :: i
- real,allocatable :: a(:,:)
- write(*,*)'Input the size of the square matrix'
- read(*,*)i
- allocate(a(i,i))
- a = function1(i)
- write(*,*) 'The square matrix a='
- write(*,*) a
- deallocate(a)
- end program main1
- module module1
- contains
- function function1(i)
- real, allocatable,dimension(:,:) :: function1
- integer :: i
- allocate(function1(i,i))
- function1 = 1.0
- deallocate(function1)
- end function function1
- end module
- do j=1,i
- write(*,*) a(:,j)
- enddo
- 1.000 1.000 1.000
- 1.000 1.000 1.000
- 1.000 1.000 1.000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement