subroutine wrtdmx(ierror) IMPLICIT DOUBLE PRECISION (A-H,O-Z) #include "divcon.dim" #include "divcon.h" C By Arjan van der Vaart C text file instead of binary, so easy portable between C different architectures ! call opnfil(idmx,ierror) ! open(unit=idmx,file=fname(idmx),iostat=ierror) ! if (ierror.ne.0) then ! return ! endif if (myid.eq.0) then call opnfil(9,ierror) if (ierror.ne.0) then C-RDC write(iout,'(/" ERROR: COULD NOT OPEN ",A20)') fname(9) return endif else call opnpfil(19,ierror) if (ierror.ne.0) then C-RDC write(iout,'(/" ERROR: COULD NOT OPEN ",A20)') fname(19) return endif endif C number of atoms write(idmx,'(i8)') natoms C atomkinds write(idmx,'(10i8)') (iatnum(i),i=1,natoms) C pairlist write(idmx,'(10i8)') (ip1(i),i=1,natoms+1) ie = ip1(natoms+1)-1 write(idmx,'(10i8)') (ipair(i),i=1,ie) write(idmx,'(10i8)') (iimat(i),i=1,natoms) ipmax = ip1(natoms+1) write(idmx,'(10i8)') (ijmat(i),i=1,ipmax) C density matrix do 30 i=1,natoms iai = iatnum(i) norbsi = natorb(iai) if(norbsi.eq.0) go to 30 ij = iimat(i) do 20 ii=1,norbsi write(idmx,'(4F25.20)') (pdiag(k),k=ij,ij+ii-1) ij = ij + ii 20 continue 30 continue write(idmx,'(4F25.20)') (pdiat(i),i=1,ijmat(ipmax)-1) close (idmx) end