Close the current table.
The table on the current table is closed with a curly bracket. If this bracket should be put to the same line as the last entry of the table, you have to set advance_previous = .false.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(aot_out_type), | intent(inout) | :: | put_conf | |||
logical, | intent(in), | optional | :: | advance_previous |
subroutine aot_out_close_table(put_conf, advance_previous)
!------------------------------------------------------------------------
type(aot_out_type), intent(inout) :: put_conf
logical, optional, intent(in) :: advance_previous
!------------------------------------------------------------------------
logical :: loc_adv_prev
character(len=max(put_conf%indent-put_conf%in_step,0)) :: indent
character(len=3) :: adv_string
!------------------------------------------------------------------------
indent = ''
adv_string = 'yes'
if (present(advance_previous)) then
loc_adv_prev = advance_previous
else
loc_adv_prev = .true.
end if
put_conf%indent = max(put_conf%indent - put_conf%in_step, 0)
put_conf%stack(put_conf%level) = 0
put_conf%level = max(put_conf%level - 1, 0)
if (put_conf%level > 0) then
! Do not advance, to let the next entry append the separator to the line.
adv_string = 'no'
end if
! Close last entry without separator.
if (loc_adv_prev) then
! Closing brace should be on new line.
write(put_conf%outunit,*) ''
write(put_conf%outunit, fmt="(a)", advance=adv_string) indent//'}'
else
! Closing brace on same line as last entry.
write(put_conf%outunit, fmt="(a)", advance=adv_string) ' }'
end if
end subroutine aot_out_close_table