CCL: Fortran question



Ahmed:

  It is not too easy to answer this question because you do provide the format of these data, and you don’t show us the code you have written to attempt read/write of  these data.  We need to know if this is free format or fixed format.  You say the output stops on the word benzene.  This suggests that you are trying to write a character (letter) into a variable (number) format.  If so, this can’t be done. 

  Regards, Dave Close.

From: owner-chemistry+closed==etsu.edu==Ìl.net [mailto:owner-chemistry+closed==etsu.edu==Ìl.net] On Behalf Of Ahmed E. Ismail aei=alum.mit.edu
Sent: Friday, August 12, 2011 3:03 PM
To: Close, David M.
Subject: CCL: Fortran question

 

It's very hard for us to answer a question like that when you don't show us what code you used to read in the file, and what you used to output it. it might be an issue with your formatting command—you've set up a loop condition that fails immediately, preventing anything from being written. Or there's a thousand other possibilities. But reading and writing data in Fortran isn't too hard, if you know the format of the data.

 

—AEI

On 12 August 2011 20:29, Richard Leo Wood rwoodphd||msn.com <owner-chemistry|*|ccl.net> wrote:


Sent to CCL by: "Richard Leo Wood" [rwoodphd(_)msn.com]
Hi all,

I have a real simple Fortran question-however, I cna't seem to find the answer anywhere and I've looked everywhere.

I'm trying to write a Fortran program that will read in an external molecule file in dat format, manipulate it and then write the output to a new dat file.

I'm at the point where I am reading in the file and trying to write it out.

Here's my file:

00012  benzene
 002 00002 2 00006 1 00007 1 00000 0 00000 0 00000 0 -000.696800 -001.210000 -000.001000 0  10      000.00000000.00000
 002 00001 2 00003 1 00008 1 00000 0 00000 0 00000 0 0000.699600 -001.208900 0000.000000 0  10      000.00000000.00000
 002 00002 1 00004 2 00009 1 00000 0 00000 0 00000 0 0001.396500 0000.001200 0000.001000 0  10      000.00000000.00000
 002 00003 2 00005 1 00010 1 00000 0 00000 0 00000 0 0000.697000 0001.209900 0000.001000 0  10      000.00000000.00000
 002 00004 1 00006 2 00011 1 00000 0 00000 0 00000 0 -000.699400 0001.208600 0000.000000 0  10      000.00000000.00000
 002 00001 1 00005 2 00012 1 00000 0 00000 0 00000 0 -001.396500 -000.001400 -000.001000 0  10      000.00000000.00000
 041 00001 1 00000 0 00000 0 00000 0 00000 0 00000 0 -001.247600 -002.165800 -000.001800 0  21      000.00000000.00000
 041 00002 1 00000 0 00000 0 00000 0 00000 0 00000 0 0001.252000 -002.163700 0000.000000 0 21       000.00000000.00000
 041 00003 1 00000 0 00000 0 00000 0 00000 0 00000 0 0002.499600 0000.002400 0000.001800 0 21       000.00000000.00000
 041 00004 1 00000 0 00000 0 00000 0 00000 0 00000 0 0001.247700 0002.165800 0000.001800 0 21       000.00000000.00000
 041 00005 1 00000 0 00000 0 00000 0 00000 0 00000 0 -001.252000 0002.163400 0000.000000 0 21       000.00000000.00000
 041 00006 1 00000 0 00000 0 00000 0 00000 0 00000 0 -002.499600 -000.002600 -000.001800 0 21       000.00000000.00000

I read it in, and when I write it out to a new file, all I get is the 00012.

So, that's all it is reading in or all it is writing out.  How can I get my code to read the whole molecule in and then write it all back out?

TIA.



-= This is automatically added to each message by the mailing script =-<br


E-mail to subscribers: CHEMISTRY|*|ccl.net or use:
     http://www.ccl.net/cgi-bin/ccl/send_ccl_message

E-mail to administrators: CHEMISTRY-REQUEST|*|ccl.net or use
     http://www.ccl.net/cgi-bin/ccl/send_ccl_message

Subscribe/Unsubscribe:
     http://www.ccl.net/chemistry/sub_unsub.shtml

Before posting, check wait time at: http://www.ccl.net

Job: http://www.ccl.net/jobs
Conferences: http://server.ccl.net/chemistry/announcements/conferences/

Search Messages: http://www.ccl.net/chemistry/searchccl/index.shtml
<br
     http://www.ccl.net/spammers.txt

RTFI: http://www.ccl.net/chemistry/aboutccl/instructions/




--
=========================
Ahmed E. Ismail
aei|*|alum.mit.edu
aei|*|aya.yale.edu