list_dirs Subroutine

public subroutine list_dirs(str)

Subroutine that returns a list of subdirectories

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in), optional :: str

Source Code

   subroutine list_dirs(str)
   !! Subroutine that returns a list of subdirectories
   implicit none
   character(len = *), intent(in), optional :: str

      if ( present(str) ) then
         call execute_command_line("find . -maxdepth 1 -type d -name ""*" // trim(str) // "*"" > " // trim(str) // ".scratch")
      else
         call execute_command_line("find . -maxdepth 1 -type d > dirs.scratch")
      endif

   return
   endsubroutine list_dirs