I am getting this error while compiling on fortran 95!
C:\..\first.F95(21) : error 199 - Array VEL appears in this expression as rank 1, but was declared as rank 2
C:\..\first.F95(21) : error 199 - Array VEL appears in this expression as rank 1, but was declared as rank 2
Here is the code:
PROGRAM first
real,parameter:: g=9.8 !Value of g
real,parameter:: rhoref=1028.0 !reference density
real,parameter:: pi=3.14 !pi
integer,parameter:: nx=11 !horizontal
integer,parameter:: nz=5 !vertical
real:: wspeed !wind speed
integer:: k !grid index
character(3):: txt
real::ele(0:nx+1) !sea level elevation
real::vel(0:nz+1,0:nx+1) !vertical velocity
do k=0, nx+1
if(k>50) then
ele(k)=1
else
ele(k)=0
end if
end do
open(10,file='result.txt',form='formatted', status='unknown')
write(10,*) (vel(k),k=1,nx)
ENDPROGRAM first
Any help is appreciated.
C:\..\first.F95(21) : error 199 - Array VEL appears in this expression as rank 1, but was declared as rank 2
C:\..\first.F95(21) : error 199 - Array VEL appears in this expression as rank 1, but was declared as rank 2
Here is the code:
PROGRAM first
real,parameter:: g=9.8 !Value of g
real,parameter:: rhoref=1028.0 !reference density
real,parameter:: pi=3.14 !pi
integer,parameter:: nx=11 !horizontal
integer,parameter:: nz=5 !vertical
real:: wspeed !wind speed
integer:: k !grid index
character(3):: txt
real::ele(0:nx+1) !sea level elevation
real::vel(0:nz+1,0:nx+1) !vertical velocity
do k=0, nx+1
if(k>50) then
ele(k)=1
else
ele(k)=0
end if
end do
open(10,file='result.txt',form='formatted', status='unknown')
write(10,*) (vel(k),k=1,nx)
ENDPROGRAM first
Any help is appreciated.