Skip to content

Instantly share code, notes, and snippets.

@andersx
Created October 5, 2018 09:49
Show Gist options
  • Select an option

  • Save andersx/44c1515ecd54da258e4440b035cc9d13 to your computer and use it in GitHub Desktop.

Select an option

Save andersx/44c1515ecd54da258e4440b035cc9d13 to your computer and use it in GitHub Desktop.
example for C-style preprocessor flag for interoperability between ifort and gfortran (note file extension is .F90 and not .f90)
program tester
#if defined _OPENMP
use omp_lib, only: omp_get_wtime
#endif
implicit none
double precision :: t1, t2
t1 = 0.0d0
t2 = 0.0d0
#if defined _OPENMP
t1 = omp_get_wtime()
#endif
call sleep(1)
#if defined _OPENMP
t2 = omp_get_wtime()
#endif
write (*,*) "HEY", t2 - t1
end program tester
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment