msg-byu / enumlib

Derivative structure enumeration library
MIT License
59 stars 34 forks source link

Can't compile convert_structures_to_enumformat.x. #37

Closed wsmorgan closed 7 years ago

wsmorgan commented 7 years ago

When attempting to compile convert_structures_to_enumformat.x the following errors occur:

../aux_src/convert_structures_to_enumformat.f90:621.18:

  subroutine co_ca(unit,error)
                  1
../aux_src/convert_structures_to_enumformat.f90:570.4:

use io_utils
    2
Error: Procedure 'co_ca' at (1) is already defined at (2)
../aux_src/convert_structures_to_enumformat.f90:621.30:

  subroutine co_ca(unit,error)
                              1
Error: Cannot change attributes of USE-associated symbol co_ca at (1)
../aux_src/convert_structures_to_enumformat.f90:622.17:

    implicit none
                 1
Error: Unexpected IMPLICIT NONE statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:623.73:

    character(50) phrase !letter: contains the first letter of every line
                                                                         1
Error: Unexpected data declaration statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:624.48:

    logical   com !true if comment line is found
                                                1
Error: Unexpected data declaration statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:625.63:

    integer  unit, i, ios !unit specifies the unit to read from
                                                               1
Error: Unexpected data declaration statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:626.17:

    logical error
                 1
Error: Unexpected data declaration statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:628.17:

    com = .true.; error = .false.
                 1
Error: Unexpected assignment statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:628.33:

    com = .true.; error = .false.
                                 1
Error: Unexpected assignment statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:629.32:

    do while ( com .eqv. .true.)
                                1
Error: Unexpected DO statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:630.38:

       read(unit,50,iostat=ios) phrase
                                      1
Error: Unexpected READ statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:631.23:

       if (ios/=0) exit
                       1
Error: EXIT statement at (1) is not within a construct
../aux_src/convert_structures_to_enumformat.f90:633.32:

       if (phrase .ne. ' ') then
                                1
Error: Unexpected block IF statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:634.32:

          i = index(phrase, '#')
                                1
Error: Unexpected assignment statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:636.28:

          if (i .ne. 0) then
                            1
Error: Unexpected block IF statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:638.31:

             if (i .ne. 1) then
                               1
Error: Unexpected block IF statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:639.16:

                phrase = phrase(1:i-1)
                1
Error: Unclassifiable statement at (1)
../aux_src/convert_structures_to_enumformat.f90:640.49:

                if (phrase .ne. ' ') com= .false.
                                                 1
Error: Unexpected simple IF statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:641.16:

             endif
                1
Error: Expecting END PROGRAM statement at (1)
../aux_src/convert_structures_to_enumformat.f90:642.14:

          else
              1
Error: Unexpected ELSE statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:643.26:

             com = .false.
                          1
Error: Unexpected assignment statement in CONTAINS section at (1)
../aux_src/convert_structures_to_enumformat.f90:644.13:

          endif
             1
Error: Expecting END PROGRAM statement at (1)
../aux_src/convert_structures_to_enumformat.f90:645.10:

       endif
          1
Error: Expecting END PROGRAM statement at (1)
../aux_src/convert_structures_to_enumformat.f90:646.7:

    end do
       1
Error: Expecting END PROGRAM statement at (1)
../aux_src/convert_structures_to_enumformat.f90:647.15:

50  format(50a)
               1
Error: Unexpected FORMAT statement in CONTAINS section at (1)
Fatal Error: Error count reached limit of 25.

I believe that all the errors actually stem from the redundant declaration of co_ca but I may be wrong.

wsmorgan commented 7 years ago

The issue was being caused because co_ca is defined in the driver and in io_utils.f90. Removing use io_utils from the driver fixed the issue. This is implemented in revision 1.0.7.