PDA

View Full Version : Fortran Formatting Computational Chemistry


Morberticus
Jul27-10, 09:09 AM
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

DrDu
Jul27-10, 09:42 AM
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 ***.

sasalazic
Aug3-10, 11:34 AM
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.