Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer, | intent(in) | :: | hydrotope_input_fid | |||
integer, | intent(in) | :: | subbasin_input_fid |
subroutine output_initialise_labelled(hydrotope_input_fid, subbasin_input_fid)
use utilities, only: string_index
!use input, only: read_string_column
use input, only: read_string_column, has_column
integer, intent(in) :: hydrotope_input_fid, subbasin_input_fid
integer i, ucount
logical ir
ir = any(output_files(:)%space == 4)
if (ir .and. has_column("output_label", hydrotope_input_fid)) then
allocate(output_hydrotope_label(output_nhydrotopes))
output_hydrotope_label = ''
call read_string_column(hydrotope_input_fid, 'output_label', output_hydrotope_label)
ucount = 0
do i = 1, output_nhydrotopes
if (trim(output_hydrotope_label(i)) /= '') ucount = ucount + 1
end do
allocate(output_hydrotope_label_ix(ucount))
ucount = 0
do i = 1, output_nhydrotopes
if (trim(output_hydrotope_label(i)) /= '') then
ucount = ucount + 1
output_hydrotope_label_ix(ucount) = i
end if
end do
else if (ir) then
call log_error("output_initialise_labelled", &
"hydrotope_label output requested but output_label column not found.")
end if
ir = any(output_files(:)%space == 5)
if (ir .and. has_column("output_label", subbasin_input_fid)) then
allocate(output_subbasin_label(output_nsubbasins))
output_subbasin_label = ''
call read_string_column(subbasin_input_fid, 'output_label', output_subbasin_label)
ucount = 0
do i = 1, output_nsubbasins
if (trim(output_subbasin_label(i)) /= '') ucount = ucount + 1
end do
allocate(output_subbasin_label_ix(ucount))
ucount = 0
do i = 1, output_nsubbasins
if (trim(output_subbasin_label(i)) /= '') then
ucount = ucount + 1
output_subbasin_label_ix(ucount) = i
end if
end do
else if (ir) then
call log_error("output_initialise_labelled", &
"subbasin_label output requested but output_label column not found.")
end if
end subroutine output_initialise_labelled