-
Notifications
You must be signed in to change notification settings - Fork 49
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
c0b267d
commit fd460e5
Showing
1 changed file
with
41 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,41 @@ | ||
module parse_tracers | ||
|
||
integer, parameter :: NO_TRACER = -99 | ||
|
||
public get_tracer_index, NO_TRACER | ||
|
||
CONTAINS | ||
|
||
function get_tracer_index (tracer_names, name, me, master, debug) | ||
|
||
character(len=32), intent(in) :: tracer_names(:) | ||
character(len=*), intent(in) :: name | ||
integer, intent(in) :: me | ||
integer, intent(in) :: master | ||
logical, intent(in) :: debug | ||
!--- local variables | ||
integer :: get_tracer_index | ||
integer :: i | ||
|
||
get_tracer_index = NO_TRACER | ||
|
||
do i=1, size(tracer_names) | ||
if (trim(name) == trim(tracer_names(i))) then | ||
get_tracer_index = i | ||
exit | ||
endif | ||
enddo | ||
|
||
if (debug .and. (me == master)) then | ||
if (get_tracer_index == NO_TRACER) then | ||
print *,' PE ',me,' tracer with name '//trim(name)//' not found' | ||
else | ||
print *,' PE ',me,' tracer FOUND:',trim(name) | ||
endif | ||
endif | ||
|
||
return | ||
|
||
end function get_tracer_index | ||
|
||
end module parse_tracers |