- #1
camila
- 4
- 0
hello,
I have a tricky question with arrays involved. I am trying to made a code who can read precipitation, so i have 3 kinds of strings: 1.numbers, 2.0 ,3. blank steps. I need to change the blanks into the smallest number who can read fortran. I was reading and the other options is using iostat, but this function change the blank space into 1 or zero, and i can't have a zero in a blank space.
Data=45 years, with monthly precipitation.
The data is string like this: ':35.5' or ':0' or ' '
(im using the data from excel, i changed with .csv, I am using this code to change the strings into a float type, but the blank spaces doesn't list in the final result, and the final result its less data).
5000 format(x,a8) !i made this to erase :
Thanks!
I have a tricky question with arrays involved. I am trying to made a code who can read precipitation, so i have 3 kinds of strings: 1.numbers, 2.0 ,3. blank steps. I need to change the blanks into the smallest number who can read fortran. I was reading and the other options is using iostat, but this function change the blank space into 1 or zero, and i can't have a zero in a blank space.
Data=45 years, with monthly precipitation.
The data is string like this: ':35.5' or ':0' or ' '
(im using the data from excel, i changed with .csv, I am using this code to change the strings into a float type, but the blank spaces doesn't list in the final result, and the final result its less data).
Fortran:
!change strings into a float type
character*50, dimension(12,45)::a
character(len=8), dimension(12,45)::net_pr
double precision, dimension (12,45)::d
do i=1,45
do j=1,12
read (net_pr(x,y),5000)a(x,y)
read(a(x,y),*)d(x,y)
end do
end do
5000 format(x,a8) !i made this to erase :
Thanks!