!PDB File Record Format
!COLUMNS        DATA  TYPE    FIELD        DEFINITION
!-------------------------------------------------------------------------------------
! 1 -  6        Record name   "ATOM  "
! 7 - 11        Integer       serial       Atom  serial number.
!13 - 16        Atom          name         Atom name.
!17             Character     altLoc       Alternate location indicator.
!18 - 20        Residue name  resName      Residue name.
!22             Character     chainID      Chain identifier.
!23 - 26        Integer       resSeq       Residue sequence number.
!27             AChar         iCode        Code for insertion of residues.
!31 - 38        Real(8.3)     x            Orthogonal coordinates for X in Angstroms.
!39 - 46        Real(8.3)     y            Orthogonal coordinates for Y in Angstroms.
!47 - 54        Real(8.3)     z            Orthogonal coordinates for Z in Angstroms.
!55 - 60        Real(6.2)     occupancy    Occupancy.
!61 - 66        Real(6.2)     tempFactor   Temperature  factor.
!77 - 78        LString(2)    element      Element symbol, right-justified.
!79 - 80        LString(2)    charge       Charge  on the atom.
    
    program DL_POLY_CONFIG
    implicit none                              !implicit(˵����ĳһ��ĸ��ͷ�ı���Ϊָ��������)
    real, PARAMETER :: K = 0                   !parameter(Ϊ��������������һ�����Ŵ���һ������)
    real, PARAMETER :: cell = 100.0            !ԭ������
    integer, PARAMETER :: P = 15304              !ԭ������
    integer, PARAMETER :: levcfg = 0
    integer, PARAMETER :: imcon = 2
    character *72 header, remark
    character *20 atom, atmnam, mol_id, molecule, element 
    integer serial, resSeq  
    real Cx, Cy, Cz, occupancy, tempFactor
    integer i
    open(20, file = 'CONFIG', status = 'unknown')     !��һ������ļ�
    open(1, file = 'BmimNTf2&Graphene.pdb', status = 'unknown')     !���ļ�������ȡ
    read(1, *) header
    write(20, "(A72)") header
    read(1, *) remark
    write(20, "(I10, I10, I10)") levcfg, imcon, P
    write(20, "(F20.10, F20.10, F20.10)") cell, K, K
    write(20, "(F20.10, F20.10, F20.10)") K, cell, K
    write(20, "(F20.10, F20.10, F20.10)") K, K, cell
    do i = 1, P
        read(1,*) atom, serial, atmnam, mol_id, molecule, resSeq, Cx, Cy, Cz, occupancy, tempFactor, element
        if(atom /= 'TER') then
            write(20, "(A8, I10)") atmnam, i
            write(20, "(F20.3, F20.3, F20.3)") Cx, Cy, Cz
        endif
    end do
    end