Firefly and PC GAMESS-related discussion club



Learn how to ask questions correctly


Re^6: How to produce output in machine-easy-readable format, e.g. binary?

Andriy Zhugayevych
azh@ukr.net


Thank you, Alex, for the detailed explanation.

Attached is the Fortran code of the command-line program "readdict" extracting a record from DICTNRY file. The usage is as follows:

readdict dictnry outfile code

Here "readdict" program reads "dictnry" file, extracts the record #"code", and copy it to "outfile" file. The list of codes was provided by Alex Granovsky, to see this list run

readdict

I did not write the promised Maple routine, because "readdict" program gives a better solution.

Best regards,
Andriy Zhugayevych



On Sat Aug 20 '11 12:08pm, Alex Granovsky wrote
-----------------------------------------------
>Dear Andriy,

>Sorry for delay with my reply.

>I decided to put (significantly simplified) pieces of Fortran code  
>to allow one to read DICTNRY file.

>First, one need to open DICTNRY file:

>
>       irecln = 4096 ! record size in DP words
>       open (unit=idaf, file='DICTNRY', status='OLD',
>     *       access='DIRECT', form='UNFORMATTED',
>     *       action='READ', recl=irecln*8)
>

>Then, one need to read master record:

>
>       integer ioda(496), ifilen(496)

>       read(unit=idaf,rec=1,err=100)idummy,ioda,ifilen,idummy2,idummy3
>

>Finally, one can read information records:

>
>      N = IODA(NREC)
>      IF(N .EQ. -1) CALL ABORT()
>      IS = -IRECLN + 1
>      NS = N
>      LENT = LEN
>      DO
>  100 CONTINUE
>         IS = IS + IRECLN
>         IF = IS + LENT - 1
>         IF ((IF-IS+1) .GT. IRECLN) IF = IS + IRECLN - 1
>         NSP = NS
>         LENW = IF - IS + 1
>         CALL DARD(V(IS),LENW,IDAF,NSP,IDTYP,NREC)
>         LENT = LENT - IRECLN
>         NS = NS + 1
>         N = NS
>         IF (LENT .LT. 1) EXIT
>      END DO  

>      RETURN
>      END
>
>
>      SUBROUTINE DARD(V,LEN,IDAF,NS,IDTYP,NREC)
>      IMPLICIT DOUBLE PRECISION (A-H,O-Z)

>      DIMENSION V(LEN)

>      CALL READREC(V,LEN,IDAF,NS)

>      RETURN
>      END
>
>
>      subroutine readrec(xbuf,len, is,irc)
>      implicit double precision (a-h,o-z)

>      dimension xbuf(len)

>      read (unit=is, rec=irc) xbuf

>      return
>      end
>

>The list of some useful records is:

>

               1. Atomic coordinates
               3. Gradient vector
               4. Hessian (force constant) matrix
              11. Bare nucleus Hamiltonian integrals
              12. Overlap integrals
              13. Kinetic energy integrals
              14. Alpha Fock matrix (current)
              15. Alpha orbitals
              16. Alpha density matrix
              17. Alpha energies or occupation numbers
              18. Beta Fock matrix (current)
              19. Beta orbitals
              20. Beta density matrix
              21. Beta energies or occupation numbers

>
>Note, symmetric matrices are stored in packed upper triangular form thus consuming (N*(N+1))/2 DP words of storage.

>Hope this helps.

>Kind regards,
>Alex Granovsky
>
>
>
>On Thu Aug 11 '11 1:33am, Andriy Zhugayevych wrote
>--------------------------------------------------
>>Thank you, Alex,

>>Please give the information on the structure of DICTNRY file. I will write a Maple routine (Fortran-like syntax) for extracting eigenelements and overlap matrix and will post the code here.

>>Maple users, please visit http://zhugayevych.me/maple/index.htmhttp://zhugayevych.me/maple/index.htmhttp://zhugayevych.me/maple/index.htmhttp://zhugayevych.me/maple/index.htm for a Maple package providing interface to Firefly. The current version of the package, which is the first version ("as is" version), will be updated at the end of this year (with the mentioned code included).

>>Best regards,
>>Andriy Zhugayevych
>>
>>
>>
>>On Wed Aug 10 '11 3:29pm, Alex Granovsky wrote
>>----------------------------------------------
>>>Dear Andriy,

>>>actually, with present versions of Firefly, file DICTNRY
>>>has rather simple structure which is closely resembling
>>>that of GAMESS (US). Basically, all you need is to know
>>>the structure of record no. 1, the size of physical records
>>>and the logical record numbers for data you are interested in.

>>>If you do not hate some low-level file I/O programming,
>>>please let me know and I'll post additional information here.
>>>Perhaps, you could be interested to make your program publicly available to the Community.

>>>Kind regards,
>>>Alex Granovsky
>>>
>>>
>>>
>>>On Thu Aug 4 '11 8:02pm, Andriy Zhugayevych wrote
>>>-------------------------------------------------
>>>>Thank you, do you know such kind of conversion program, except Datagam? If the only solution is to read Firefly output file, do you know how to change the default 6-digits precision of the Firefly and avoid fixed-text-field-width overflow for large atomic basis sets and heavy atoms?
>>>>
>>>>
>>>>On Thu Aug 4 '11 2:24am, Amir Nasser Shamkhali wrote
>>>>----------------------------------------------------
>>>>>Dear Andriy
>>>>>I think that you can open very larg output files by programmer file editor (PFE32.exe) program which is free for download. This software opens verly larg text files rapidly with variety of options. Also in order to read very large results such as molecular orbitals and etc, you can write a simple fortran program too read and save a part of out file.

>>>>>Sincerely
>>>>>
>>>>>
>>>>>On Tue Aug 2 '11 3:26am, Andriy Zhugayevych wrote
>>>>>-------------------------------------------------
>>>>>>For large scale calculations (say 2000 basis functions) the standard Firefly-output requires a lot of time (comparable with Firefly run-time) to read eigenvectors, overlap matrix etc. when importing them into other programs, mainly because of keyword searching through large-size file, human-oriented formatting, text-field overflow checking. PUNCH file is more machine-friendly, but it does not contain e.g. overlap matrix. DICTNRY is not documented as far as I know. Datagam postprocessing capabilities are very limited. Is there a way to obtain eigenvalues, eigenvectors, overlap matrix in a compact format, e.g. binary or text similar to AUX-file in MOPAC (with the possibility to increase the output precision)?

This message contains the 2 kb attachment
[ readdict.f90 ] Fortran code for "readdict" program


[ Previous ] [ Next ] [ Index ]           Sun Aug 21 '11 3:38am
[ Reply ] [ Edit ] [ Delete ]           This message read 1051 times