From 3cb1ef0abe04ce07143f170d713a9108c3f388f9 Mon Sep 17 00:00:00 2001
From: Sebastien MASSON <massons@irene150.c-irene.tgcc.ccc.cea.fr>
Date: Thu, 1 Sep 2022 22:43:27 +0200
Subject: [PATCH] add missing fix on stpctl.F90 for STATION_ASF, #68

---
 tests/STATION_ASF/MY_SRC/stpctl.F90 | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/STATION_ASF/MY_SRC/stpctl.F90 b/tests/STATION_ASF/MY_SRC/stpctl.F90
index a889111ad..8923df79f 100644
--- a/tests/STATION_ASF/MY_SRC/stpctl.F90
+++ b/tests/STATION_ASF/MY_SRC/stpctl.F90
@@ -159,9 +159,9 @@ CONTAINS
             ! first: close the netcdf file, so we can read it
             IF( lwm .AND. kt /= nitend )   istatus = NF90_CLOSE(nrunid)
             ! get global loc on the min/max
-            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk, zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F
-            CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk, zzz, iloc(1:2,2) )
-            CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk, zzz, iloc(1:2,3) )
+            CALL mpp_maxloc( 'stpctl',    taum(:,:)  , llmsk(A2D(0)), zzz, iloc(1:2,1) )   ! mpp_maxloc ok if mask = F
+            CALL mpp_maxloc( 'stpctl',ABS( qns(:,:) ), llmsk(A2D(0)), zzz, iloc(1:2,2) )
+            CALL mpp_minloc( 'stpctl',ABS( emp(:,:) ), llmsk        , zzz, iloc(1:2,3) )
             ! find which subdomain has the max.
             iareamin(:) = jpnij+1   ;   iareamax(:) = 0   ;   iareasum(:) = 0
             DO ji = 1, jptst
@@ -174,9 +174,9 @@ CONTAINS
             CALL mpp_sum( "stpctl", iareasum )         ! sum over the global domain
          ELSE                    ! find local min and max locations:
             ! if we are here, this means that the subdomain contains some oce points -> no need to test the mask used in maxloc
-            iloc(1:2,1) = MAXLOC(     taum(:,:)  , mask = llmsk )
-            iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk )
-            iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk )
+            iloc(1:2,1) = MAXLOC(     taum(:,:)  , mask = llmsk(A2D(0)) )
+            iloc(1:2,2) = MAXLOC( ABS( qns(:,:) ), mask = llmsk(A2D(0)) )
+            iloc(1:2,3) = MINLOC( ABS( emp(:,:) ), mask = llmsk         )
             DO ji = 1, jptst   ! local domain indices ==> global domain indices, excluding halos
                iloc(1:2,ji) = (/ mig(iloc(1,ji),0), mjg(iloc(2,ji),0) /)
             END DO
-- 
GitLab