| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(input_t), | intent(inout) | :: | me | |||
| character(len=*), | intent(in) | :: | file_name | |||
| logical, | intent(in), | optional | :: | included |
ignore it - only present for included files |
recursive subroutine input_open_yaml(me,file_name,included) class(input_t), intent(inout) :: me character(*), intent(in) :: file_name logical, optional, intent(in) :: included !! ignore it - only present for included files class(type_node), pointer :: cmp_tree character(:), allocatable :: error,folder type(type_dictionary) :: no_cmp type(type_dictionary), pointer :: root_dict logical :: file_exists folder = file_name(:index(file_name,'/',.true.)) inquire(file=file_name, exist=file_exists) if (.not. file_exists) error stop 'Input file not found: '//file_name call me%file%parse(file_name, error) if (allocated(error)) error stop 'YAML parse error in "'//file_name//'": '//error me%root => me%file%root call scan_yaml(me%file%root,folder) if (.not.present(included)) then root_dict => select_dict(me%root); ! It is top level input file cmp_tree => root_dict%get('components') call rename_components(cmp_tree,no_cmp,'','') call allocate_components(me,no_cmp) call fill_components(me,cmp_tree,no_cmp) endif end subroutine input_open_yaml