You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Something so we can avoid these annoying nested select type blocks.
So if you want to check if several variables are integers:
! if several variables are integers
select type (a,b,c) ! new syntax
class is (integer)
d = a + b + c
end select
Or if you want to check if a variable is any integer kind:
select type (a)
class is (integer(kind=*)) ! new syntax
d = a *2
end select
Or any numeric kind:
select type (a)
class is (integer(kind=*), real(kind=*)) ! new syntax
d =1*2
end select
And all together:
select type (a,b,c) ! new syntax
class is (integer(kind=*), real(kind=*)) ! new syntax
! a, b, and c are all either integers or reals,
! so compiler knows what todo here:
d = a + b + c
end select
The text was updated successfully, but these errors were encountered:
Something so we can avoid these annoying nested
select type
blocks.So if you want to check if several variables are integers:
Or if you want to check if a variable is any integer kind:
Or any numeric kind:
And all together:
The text was updated successfully, but these errors were encountered: