Merge branch 'fixf'
[wrf-fire-matlab.git] / femwind / fortran / module_msleep.f90
blobca1aaa16cbdf243c6e8feeb7eae9714d01e837fc
1 module module_msleep
3 contains
5 subroutine call_msleep(m)
6 ! sleep m miliseconds
7 use, intrinsic :: iso_c_binding, only: c_long
9 implicit none
11 interface
12 ! Correctly declare the C function as a subroutine in Fortran
13 subroutine msleep(msec) bind(C, name="msleep")
14 import :: c_long
15 integer(c_long), value :: msec
16 end subroutine msleep
17 end interface
19 integer :: m ! argument
20 integer(c_long) :: msec_c_long ! local
22 ! Call the C subroutine
23 msec_c_long = int(m, kind=c_long)
24 call msleep(msec_c_long) ! Sleep for 1000 milliseconds or 1 second
25 end subroutine call_msleep
27 end module module_msleep