Skip to content

Commit

Permalink
Merge branch 'singhbalwinder/sea-ice/fix-threading-bug-maint2' into m…
Browse files Browse the repository at this point in the history
…aint-2.0 (PR #5063)

Adds omp critical directives for ice warnings (for maint2.0)

While running some ensemble members for v2 on Cori-KNL, we occasionally
hit errors like "forrtl: severe (151): allocatable array is already
allocated" pointing to ice_warnings.f90 file. Adding an "omp critical"
section in this file fixes these errors.

[BFB]
  • Loading branch information
jonbob committed Jul 25, 2022
2 parents dd93524 + 2094b26 commit 6aa83b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/mpas-seaice/src/column/ice_warnings.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ subroutine add_warning(warning)
integer :: &
nWarningsArray, & ! size of warnings array at start
iWarning ! warning index

!$omp critical (ice_warnings_add_warning_critical)
! check if warnings array is not allocated
if (.not. allocated(warnings)) then

Expand Down Expand Up @@ -90,7 +90,7 @@ subroutine add_warning(warning)

! add the new warning
warnings(nWarnings) = trim(warning)

!$omp end critical (ice_warnings_add_warning_critical)
end subroutine add_warning

!=======================================================================
Expand Down

0 comments on commit 6aa83b4

Please sign in to comment.