Construct unique filenames using a base name and the mode numbers l and m for reading in external inital data. The base name is constructed based on the run time parameters input_directory and input_basename.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=ip), | intent(in) | :: | l | The -mode of this mode. |
||
integer(kind=ip), | intent(in) | :: | m | The -mode of this mode. |
The return value is the concatenation of the input_directory and input_basename and the mode information.
function construct_filename ( l, m )
!! Construct unique filenames using a base name and the mode numbers l and m
!! for reading in external inital data. The base name is constructed based
!! on the run time parameters [[parameters:input_directory]] and
!! [[parameters:input_basename]].
use parameters, only : input_directory, input_basename
implicit none
integer(ip), intent(in) :: l
!! The \(\ell\)-mode of this mode.
integer(ip), intent(in) :: m
!! The \(m\)-mode of this mode.
character(len=1024) :: construct_filename
!! The return value is the concatenation of the
!! [[parameters:input_directory]] and [[parameters:input_basename]] and the
!! mode information.
character(len=6) :: lstr, mstr
character(len=4), dimension(6) :: form = (/ "(i1)", "(i2)", "(i3)", &
"(i4)", "(i5)", "(i6)" /)
write(lstr,form(count_digits(l))) l
write(mstr,form(count_digits(m))) m
construct_filename = trim(input_directory)//'/'//trim(input_basename) &
//'_l'//trim(lstr)//'m'//trim(mstr)//'.dat'
end function construct_filename