Skip to content

Commit

Permalink
add threaded region check to seed dispersal call
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed Oct 19, 2023
1 parent c811ae9 commit 732d3b9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/utils/clmfates_interfaceMod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2669,8 +2669,21 @@ subroutine WrapGlobalSeedDispersal(this,is_restart_flag)

logical :: set_restart_flag ! local logical variable to pass to IsItDispersalTime
! if optional is_restart_flag is true
#ifdef _OPENMP
logical, external :: omp_in_parallel
#endif

type (neighbor_type), pointer :: neighbor

! Check to see if we are not in a threaded region. Fail the run if this returns true.
#ifdef _OPENMP
write(iulog,*) 'omp check: ', omp_in_parallel()
if (omp_in_parallel()) then
call endrun(msg='clmfates interface error: MPI routine called within threaded region'//&
errMsg(sourcefile, __LINE__))
end if
#endif

! This should only be run once per day
if(is_beg_curr_day()) then

Expand Down

0 comments on commit 732d3b9

Please sign in to comment.