read_gmsh_msh1_file Subroutine

public subroutine read_gmsh_msh1_file(mesh_data, msh1_file)

Arguments

Type IntentOptional Attributes Name
type(gmsh_msh1_data_type), intent(inout) :: mesh_data

The read data will be stored in this argument

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

File path to read from


Calls

proc~~read_gmsh_msh1_file~~CallsGraph proc~read_gmsh_msh1_file read_gmsh_msh1_file proc~clear_msg clear_msg proc~read_gmsh_msh1_file->proc~clear_msg proc~is_iostat_failure is_iostat_failure proc~read_gmsh_msh1_file->proc~is_iostat_failure proc~read_gmsh_msh1_file_kernel read_gmsh_msh1_file_kernel proc~read_gmsh_msh1_file->proc~read_gmsh_msh1_file_kernel proc~read_gmsh_msh1_file_kernel->proc~is_iostat_failure proc~initialize_gmsh_msh1_node initialize_gmsh_msh1_node proc~read_gmsh_msh1_file_kernel->proc~initialize_gmsh_msh1_node proc~is_iostat_success is_iostat_success proc~read_gmsh_msh1_file_kernel->proc~is_iostat_success proc~is_stat_failure is_stat_failure proc~read_gmsh_msh1_file_kernel->proc~is_stat_failure proc~read_gmsh_msh1_element read_gmsh_msh1_element proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_element proc~read_gmsh_msh1_header_footer read_gmsh_msh1_header_footer proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_header_footer proc~read_gmsh_msh1_node read_gmsh_msh1_node proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_node proc~read_gmsh_msh1_number_of_items read_gmsh_msh1_number_of_items proc~read_gmsh_msh1_file_kernel->proc~read_gmsh_msh1_number_of_items proc~initialize_gmsh_msh1_node_number initialize_gmsh_msh1_node_number proc~initialize_gmsh_msh1_node->proc~initialize_gmsh_msh1_node_number proc~read_gmsh_msh1_element->proc~clear_msg proc~read_gmsh_msh1_element->proc~is_iostat_failure proc~read_gmsh_msh1_element->proc~is_stat_failure proc~initialize_gmsh_msh1_element initialize_gmsh_msh1_element proc~read_gmsh_msh1_element->proc~initialize_gmsh_msh1_element proc~read_gmsh_msh1_node->proc~clear_msg proc~read_gmsh_msh1_node->proc~is_iostat_failure proc~read_gmsh_msh1_number_of_items->proc~is_iostat_failure proc~read_gmsh_msh1_number_of_items->proc~is_iostat_success

Variables

Type Visibility Attributes Name Initial
integer, private :: file_unit

Source Code

    subroutine read_gmsh_msh1_file(mesh_data, msh1_file)

        !> The read data will be stored in this argument
        type(gmsh_msh1_data_type), intent(inout) :: mesh_data

        !> File path to read from
        character(len=*), intent(in) :: msh1_file



        integer :: file_unit



        mesh_data%flag_nod_section_header    = initial_flag_nod_section_header
        mesh_data%flag_number_of_nodes       = initial_flag_number_of_nodes
        mesh_data%flag_deallocation_nodes    = initial_flag_deallocation_nodes
        mesh_data%flag_allocation_nodes      = initial_flag_allocation_nodes
        mesh_data%flag_nod_section_footer    = initial_flag_nod_section_footer

        mesh_data%flag_elm_section_header    = initial_flag_elm_section_header
        mesh_data%flag_number_of_elements    = initial_flag_number_of_elements
        mesh_data%flag_deallocation_elements = initial_flag_deallocation_elements
        mesh_data%flag_allocation_elements   = initial_flag_allocation_elements
        mesh_data%flag_reading_elements      = initial_flag_reading_elements
        mesh_data%flag_elm_section_footer    = initial_flag_elm_section_footer

        call clear_msg( mesh_data%status% err %msg(:) )
        call clear_msg( mesh_data%status% io  %msg(:) )



        open( &!
        newunit = file_unit                  , &!
        file    = msh1_file(:)               , &!
        action  = 'read'                     , &!
        form    = 'formatted'                , &!
        status  = 'old'                      , &!
        iostat  = mesh_data%status%io%code   , &!
        iomsg   = mesh_data%status%io%msg(:)   &!
        )

        if ( is_iostat_failure(mesh_data%status) ) return



        call read_gmsh_msh1_file_kernel(mesh_data, file_unit)



        close( &!
        unit   = file_unit                  , &!
        iostat = mesh_data%status%io%code   , &!
        iomsg  = mesh_data%status%io%msg(:)   &!
        )



        mesh_data%status%err%code = stat_success

    end subroutine read_gmsh_msh1_file