Skip to content

Commit

Permalink
change value to sval in function parse_string
Browse files Browse the repository at this point in the history
  • Loading branch information
mcallic2 committed Nov 9, 2023
1 parent ea3f6ae commit 02b33c6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mosaic2/mosaic2.F90
Original file line number Diff line number Diff line change
Expand Up @@ -553,14 +553,14 @@ function is_inside_polygon(lon1, lat1, lon2, lat2 )

end function is_inside_polygon

function parse_string(string, set, value)
function parse_string(string, set, sval)
character(len=*), intent(in) :: string
character(len=*), intent(in) :: set
character(len=*), intent(out) :: value(:)
character(len=*), intent(out) :: sval(:)
integer :: parse_string
integer :: nelem, length, first, last

nelem = size(value(:))
nelem = size(sval(:))
length = len_trim(string)

first = 1; last = 0
Expand All @@ -573,13 +573,13 @@ function parse_string(string, set, value)
endif
last = first - 1 + scan(string(first:length), set)
if(last == first-1 ) then ! not found, end of string
value(parse_string) = string(first:length)
sval(parse_string) = string(first:length)
exit
else
if(last <= first) then
call mpp_error(FATAL, "mosaic_mod(parse_string) : last <= first")
endif
value(parse_string) = string(first:(last-1))
sval(parse_string) = string(first:(last-1))
first = last + 1
! scan to make sure the next is not the character in the set
do while (first == last+1)
Expand Down

0 comments on commit 02b33c6

Please sign in to comment.