read_gmsh_msh1_number_of_items Subroutine

private subroutine read_gmsh_msh1_number_of_items(file_unit, item_name, text_line, number_of_items, status, flag)

Arguments

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

Calls

proc~~read_gmsh_msh1_number_of_items~~CallsGraph proc~read_gmsh_msh1_number_of_items read_gmsh_msh1_number_of_items proc~is_iostat_failure is_iostat_failure proc~read_gmsh_msh1_number_of_items->proc~is_iostat_failure proc~is_iostat_success is_iostat_success proc~read_gmsh_msh1_number_of_items->proc~is_iostat_success

Called by

proc~~read_gmsh_msh1_number_of_items~~CalledByGraph proc~read_gmsh_msh1_number_of_items read_gmsh_msh1_number_of_items proc~read_gmsh_msh1_file_kernel read_gmsh_msh1_file_kernel proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_number_of_items proc~read_gmsh_msh1_file read_gmsh_msh1_file proc~read_gmsh_msh1_file->proc~read_gmsh_msh1_file_kernel

Variables

Type Visibility Attributes Name Initial
character(len=1), private :: dummy

Source Code

    subroutine read_gmsh_msh1_number_of_items(file_unit, item_name, text_line, number_of_items, status, flag)

        integer, intent(in) :: file_unit

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

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

        integer, intent(out) :: number_of_items

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

        logical, intent(out) :: flag



        character(1) :: dummy



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

        if ( is_iostat_failure(status) ) then

            status%err%code   = status%io%code
            status%err%msg(:) = status%io%msg(:)

            return

        end if



        read( &!
        unit   = text_line(:)     , &!
        fmt    = *                , &!
        iostat = status%io%code   , &!
        iomsg  = status%io%msg(:)   &!
        ) &!
        number_of_items, dummy

        if ( is_iostat_success(status) ) then

            write( &!
            unit = status%err%msg(:) , &!
            fmt  = '(3A)'              &!
            ) &!
            'Extra data was detected while reading `' , &!
            item_name                                 , &!
            '`.'

            return

        end if



        read( &!
        unit   = text_line(:)     , &!
        fmt    = *                , &!
        iostat = status%io%code   , &!
        iomsg  = status%io%msg(:)   &!
        ) &!
        number_of_items

        if ( is_iostat_failure(status) ) then

            status%err%code   = status%io%code
            status%err%msg(:) = status%io%msg(:)

            return

        end if

        if (number_of_items .lt. 0) then

            write( &!
            unit = status%err%msg(:)   , &!
            fmt  = '(2(A,1X),I0,1X,A)'   &!
            ) &!
            'The number of'            , &!
            item_name                  , &!
            number_of_items            , &!
            'must be greater than -1.'

            return

        end if



        flag = .true.

    end subroutine read_gmsh_msh1_number_of_items