Fortran Fortran Formatting Computational Chemistry

AI Thread Summary
The discussion revolves around issues with formatting output in a quantum chemistry calculation program written in Fortran. The user is attempting to format a real number input but encounters a problem where the output appears as asterisks instead of the expected formatted number. The required format is specified as Dz.d, where 'd' represents the number of decimal places and 'z' is the total length of the number, including the exponent and sign, with the condition that z must be greater than or equal to d plus 7. Additionally, the user seeks assistance with extracting specific data from an ASCII file, specifically targeting the n-th row and n-th column. The need for proper formatting and data extraction techniques is emphasized as crucial for the quantum chemistry calculations.
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
 
Technology 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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
6
Views
3K
Replies
6
Views
2K
Replies
13
Views
3K
Replies
2
Views
2K
Replies
16
Views
2K
Back
Top