Hi everyone, I am trying to code using fortan 90 to read a file which I have then use the numbers for some stuff.
So far I have
"
SUBROUTINE readinput
USE simParam, ONLY: xDim,yDim,tMax,Re,obstR,obstX,obstY,obsth,tprint,pi,po
implicit none
character (LEN=100)::fileName
write(fileName,*) 1
fileName = adjustl(fileName)
open(12,file='READ'//trim(fileName)//'.dat')
read(12,101) xDim,yDim,obstX,obstY,obsth,obstR,tMax,tprint,Re,pi,po
101 format(2x,8i6,1E12.5)
close (12)
END SUBROUTINE readinput
"
It is all working fine apart from reading in "pi" and "po".
I just stuck them on the end of the code I currently use but I have obviously done something wrong....
To format in my input file (READ) is
" 500, 2000, 100,50, 10, 20,1000,10, 500,10,20.0d0 "
Im thinking its something to do with the format command?
Thanks!
So far I have
"
SUBROUTINE readinput
USE simParam, ONLY: xDim,yDim,tMax,Re,obstR,obstX,obstY,obsth,tprint,pi,po
implicit none
character (LEN=100)::fileName
write(fileName,*) 1
fileName = adjustl(fileName)
open(12,file='READ'//trim(fileName)//'.dat')
read(12,101) xDim,yDim,obstX,obstY,obsth,obstR,tMax,tprint,Re,pi,po
101 format(2x,8i6,1E12.5)
close (12)
END SUBROUTINE readinput
"
It is all working fine apart from reading in "pi" and "po".
I just stuck them on the end of the code I currently use but I have obviously done something wrong....
To format in my input file (READ) is
" 500, 2000, 100,50, 10, 20,1000,10, 500,10,20.0d0 "
Im thinking its something to do with the format command?
Thanks!