From dc8e126728e540e024b9d1f29550fb4a721380b4 Mon Sep 17 00:00:00 2001 From: Balwinder Singh Date: Wed, 6 Jul 2022 10:43:59 -0700 Subject: [PATCH 1/3] Adds omp critical directives for gathering ice warnings --- components/mpas-seaice/src/column/ice_warnings.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_warnings.F90 b/components/mpas-seaice/src/column/ice_warnings.F90 index 6747269623a9..8cbc5a219005 100644 --- a/components/mpas-seaice/src/column/ice_warnings.F90 +++ b/components/mpas-seaice/src/column/ice_warnings.F90 @@ -42,7 +42,7 @@ subroutine add_warning(warning) integer :: & nWarningsArray, & ! size of warnings array at start iWarning ! warning index - + !$omp critical ! check if warnings array is not allocated if (.not. allocated(warnings)) then @@ -90,7 +90,7 @@ subroutine add_warning(warning) ! add the new warning warnings(nWarnings) = trim(warning) - + !$omp end critical end subroutine add_warning !======================================================================= From 8bb433b107b811a68dd7b1a4bbc1403dee86981f Mon Sep 17 00:00:00 2001 From: Balwinder Singh Date: Wed, 6 Jul 2022 10:57:42 -0700 Subject: [PATCH 2/3] adds name to the omp critical section --- components/mpas-seaice/src/column/ice_warnings.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_warnings.F90 b/components/mpas-seaice/src/column/ice_warnings.F90 index 8cbc5a219005..8f455915613e 100644 --- a/components/mpas-seaice/src/column/ice_warnings.F90 +++ b/components/mpas-seaice/src/column/ice_warnings.F90 @@ -42,7 +42,7 @@ subroutine add_warning(warning) integer :: & nWarningsArray, & ! size of warnings array at start iWarning ! warning index - !$omp critical + !$omp critical ice_warnings_add_warning ! check if warnings array is not allocated if (.not. allocated(warnings)) then @@ -90,7 +90,7 @@ subroutine add_warning(warning) ! add the new warning warnings(nWarnings) = trim(warning) - !$omp end critical + !$omp end critical ice_warnings_add_warning end subroutine add_warning !======================================================================= From 2094b264c9b981f42e5a0b5763240f390c891c29 Mon Sep 17 00:00:00 2001 From: Balwinder Singh Date: Wed, 6 Jul 2022 12:09:09 -0700 Subject: [PATCH 3/3] Adds parenthesis around named critical sections --- components/mpas-seaice/src/column/ice_warnings.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/mpas-seaice/src/column/ice_warnings.F90 b/components/mpas-seaice/src/column/ice_warnings.F90 index 8f455915613e..a3424c176bb7 100644 --- a/components/mpas-seaice/src/column/ice_warnings.F90 +++ b/components/mpas-seaice/src/column/ice_warnings.F90 @@ -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 + !$omp critical (ice_warnings_add_warning_critical) ! check if warnings array is not allocated if (.not. allocated(warnings)) then @@ -90,7 +90,7 @@ subroutine add_warning(warning) ! add the new warning warnings(nWarnings) = trim(warning) - !$omp end critical ice_warnings_add_warning + !$omp end critical (ice_warnings_add_warning_critical) end subroutine add_warning !=======================================================================