Execute f32() if platform is 32-bit, or f64() if platform is 64-bit. This can be either a compile-time condition (depending on target) or a runtime detection.
program main
use iso_c_binding
implicit none
type(c_ptr) :: x
logical, parameter :: is_64 = c_sizeof(x) == 8
if (is_64) then
call f64
else
call f32
end if
end program main
import System.Info
detectArch :: IO ()
detectArch = do
case arch == "x86_64" of
True -> do f64
False -> case arch == "x86" of
True -> do f32
program main
use iso_c_binding
implicit none
type(c_ptr) :: x
logical, parameter :: is_64 = c_sizeof(x) == 8
if (is_64) then
call f64
else
call f32
end if
end program main