-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d00f5da
commit ec2c2e5
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module forsus__available | ||
!! Show what substances are available in the database | ||
contains | ||
subroutine show_available(sus) | ||
!! Show the available substances in the database | ||
use forsus_constants, only: forsus_dir, forsus_default_dir | ||
character(len=*), optional, intent(in out) :: sus | ||
integer :: funit | ||
|
||
character(len=*), parameter :: pst_command="| fzf | cut -d'.' -f1 > /tmp/forsus" | ||
|
||
|
||
if (allocated(forsus_dir)) then | ||
call system("ls " // forsus_dir // pst_command) | ||
else | ||
call system("ls " // forsus_default_dir // pst_command) | ||
end if | ||
|
||
if (present(sus)) then | ||
open(newunit=funit, file="/tmp/forsus") | ||
read(funit, "(A)") sus | ||
close(funit) | ||
end if | ||
end subroutine | ||
end module |