Try this:
winapp
integer*4 iyear,imonth,iday,ih,im,is
real*4 data(10)
open(unit=10,file='data.txt',status='old')
!line in data.txt contains:
!2008-08-13 00:00:00,20.86,20.86,18.56,30.32,30.1,29.54,22.45,36.5,0,16.95
read(10,500)iyear,imonth,iday,ih,im,is,data
500 format(i4,5(1x,i2),1x,10(f12.0))
print *,iyear,imonth,iday,ih,im,is,data
close(unit=10)
end
First, the year, month, day, hours, minutes and seconds are really integer and in fixed format, hence the first integer part of the read format.
Reading these first items effectively positions the input pointer at the first comma, which is interpreted as being the end of the first REAL data item, so to overcome this, put in a 1x to align the free format (comma separated) read with the first fractional data item. I have then used larger F formats which appear to expect no decimal places. This can be important on some compilers, which use the actual alignment of the data and place it in the appropriate digit positions. This is however overwritten by the decimal point and the comma overrides the length of the characters being input. By putting f12.0, it allows up to 12 characters to be read and right aligns them in the field, resulting in a correct value if no decimal place is present. This was what I was taught to do back in 1973 on the ICL 1900 series computer and it still seems to work.
Regards
Ian