Hoang Trong Minh Tuan wrote:
> Can anyone help me with this, I have a file "data.dat" containing real data
> with high precision like this (2 rows).
>
> 0.596598016919984 -0.382312557470785 -0.528482344762526
> -8.771967130768960E-002 -0.708964641303998 0.120784051948388
>
> I want to read it into an array. The variable is declared as follows
>
> REAL (KIND = SELECTED_REAL_KIND(R=16), DIMENSION(1:2, 1:3) :: INPUTDATA
>
> fInput = 100
> open(UNIT = fInput, FILE="initvel.dat", IOSTAT = ios, ACTION='read', FORM
> = 'formatted')
> i = 0
> do
> i = i + 1
> read(fInput, *, IOSTAT=IOS) INPUTDATA(i)
> if (i >= 2) then
> exit
> endif
>
> However, it seems that the data is not read correctly. It looks like only
> the first 7 decimal digits are read correctly.
> 0.59659802913666 -0.38231256604195 -0.52848231792450
> -0.08771967142820 -0.70896464586258 0.12078405171633
>
You don't care about the R parameter to selected_real_kind; apparently you
meant to set P=15. There is no implementation with R less than 35, so you
basically haven't set any required limit.
|