I'm not sure if there is a built-in tool that does this. I don't know why ifort accepts this, and I assume that this is compiler-specific functionality.
an option for this, in particular, since you want it to be bullet proof, you need to create your own function.
I have not tested this, but the following may work:
double precision function logic2dbl(a) logical, intent(in) :: a if (a) then logic2dbl = 1.d0 else logic2dbl = 0.d0 end if end function logic2dbl
source share