I have a data file, some of the numbers are really big, like 1E252. How do I read data into Fortran as 1D252. I've tried declaring the variable as double and kind=16, but when its read in as 1E252, it errors.
Unfortunately, the easy solution, to parse the data file and convert all Es to Ds won't work because it also needs to be compatible with python.
Is there something more elegant than this?
program test
Integer :: i
real (kind = 8) :: another_test
Character(len=20) :: char_arr
char_arr = "1.10E+223"
Do i = 1,20
If (char_arr(i:i) == "E") then
char_arr(i:i) = "D"
EndIf
EndDo
Read(char_arr, *) another_test
Write(*,*) another_test
end program test