read_gmsh_msh1_header_footer Subroutine

private subroutine read_gmsh_msh1_header_footer(file_unit, header_footer, text_line, status, flag)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: file_unit
character(len=*), intent(in) :: header_footer
character(len=*), intent(inout) :: text_line
type(gmsh_msh1_status_type), intent(inout) :: status
logical, intent(out) :: flag

Called by

proc~~read_gmsh_msh1_header_footer~~CalledByGraph proc~read_gmsh_msh1_header_footer read_gmsh_msh1_header_footer proc~read_gmsh_msh1_file_kernel read_gmsh_msh1_file_kernel proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_header_footer proc~read_gmsh_msh1_file read_gmsh_msh1_file proc~read_gmsh_msh1_file->proc~read_gmsh_msh1_file_kernel

Source Code

    subroutine read_gmsh_msh1_header_footer(file_unit, header_footer, text_line, status, flag)

        integer, intent(in) :: file_unit

        character(len=*), intent(in) :: header_footer

        character(len=*), intent(inout) :: text_line

        type(gmsh_msh1_status_type), intent(inout) :: status

        logical, intent(out) :: flag



        read( &!
        unit   = file_unit        , &!
        fmt    = '(A)'            , &!
        iostat = status%io%code   , &!
        iomsg  = status%io%msg(:)   &!
        ) &!
        text_line(:)



        select case(status%io%code)

            case(iostat_success) 

                flag = trim( text_line(:) ) .eq. header_footer(:)

                if (flag) then
                    status%err%msg(:) = ' '
                else
                    status%err%msg(:) = 'The read text line is not `' // header_footer(:) // '`.'
                end if

            case(iostat_end)

                status%err%msg(:) = 'Failed to found the `' // header_footer(:) // '`'

            case default

                status%err%msg(:) = 'Failed to read the `' // header_footer(:) // '`'

        end select

    end subroutine read_gmsh_msh1_header_footer