Fortran Formatting Computational Chemistry

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
Morberticus
Messages
82
Reaction score
0
Hi,

I require specific formatting for a quantum chemistry calculation. But for some reason I can't seem to write using formatting. I have checked tutorials, but to no avail. Here is my toy program:

program test_format
implicit none

real :: m

write(*,*) 'Enter a number'
read(*,*) m
write(*,fmt='(d4.2)') m

end program test_format

After the user inputs a number, the program simply outputs stars: ****.

Any help would be greatly appreciated.

Thanks
 
Physics news on Phys.org
in the format Dz.d, the number d is the number of decimals after the point, the number z is the total length of the number, including the exponent, sign etc. Hence z>=d+7. If not, you get ***.
 
I have a problem, here's what the,
should be from ascii file to extract data that is the n-th row and n-th column
I do not know how. Could someone help me.