Skip to content

Commit 6aa83b4

Browse files
committed
Merge branch 'singhbalwinder/sea-ice/fix-threading-bug-maint2' into maint-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]
2 parents dd93524 + 2094b26 commit 6aa83b4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

components/mpas-seaice/src/column/ice_warnings.F90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ subroutine add_warning(warning)
4242
integer :: &
4343
nWarningsArray, & ! size of warnings array at start
4444
iWarning ! warning index
45-
45+
!$omp critical (ice_warnings_add_warning_critical)
4646
! check if warnings array is not allocated
4747
if (.not. allocated(warnings)) then
4848

@@ -90,7 +90,7 @@ subroutine add_warning(warning)
9090

9191
! add the new warning
9292
warnings(nWarnings) = trim(warning)
93-
93+
!$omp end critical (ice_warnings_add_warning_critical)
9494
end subroutine add_warning
9595

9696
!=======================================================================

0 commit comments

Comments
 (0)