From 32d63bb77e72f34c1030ed5b532c398f9363a9c1 Mon Sep 17 00:00:00 2001
From: Sebastien MASSON <massons@irene150.c-irene.tgcc.ccc.cea.fr>
Date: Wed, 6 Jul 2022 12:16:48 +0200
Subject: [PATCH] move definition of default tiles to mppini, fix bug of
 previous commit, #68

---
 src/OCE/DOM/domtile.F90 | 10 ----------
 src/OCE/LBC/mppini.F90  | 13 ++++++++++++-
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/src/OCE/DOM/domtile.F90 b/src/OCE/DOM/domtile.F90
index dd391b709..3c1f99b59 100644
--- a/src/OCE/DOM/domtile.F90
+++ b/src/OCE/DOM/domtile.F90
@@ -52,16 +52,6 @@ CONTAINS
       !!----------------------------------------------------------------------
       IF( ln_tile .AND. nn_hls /= 2 ) CALL ctl_stop('dom_tile_init: Tiling is only supported for nn_hls = 2')
 
-      ntile = 0                     ! Initialise to full domain
-      nijtile = 1
-      ntsi = Nis0
-      ntsj = Njs0
-      ntei = Nie0
-      ntej = Nje0
-      nthl = 0
-      nthr = 0
-      nthb = 0
-      ntht = 0
       l_istiled = .FALSE.
 
       IF( ln_tile ) THEN            ! Calculate tile domain indices
diff --git a/src/OCE/LBC/mppini.F90 b/src/OCE/LBC/mppini.F90
index da174b390..b59af288e 100644
--- a/src/OCE/LBC/mppini.F90
+++ b/src/OCE/LBC/mppini.F90
@@ -1413,7 +1413,18 @@ ENDIF
       Ni_0 = Nie0 - Nis0 + 1
       Nj_0 = Nje0 - Njs0 + 1
       !
-      jpkm1 = jpk-1                             !   "           "
+      jpkm1 = jpk-1
+      !
+      ntile = 0                     ! Initialise "no tile" by default
+      nijtile = 1
+      ntsi = Nis0
+      ntsj = Njs0
+      ntei = Nie0
+      ntej = Nje0
+      nthl = 0
+      nthr = 0
+      nthb = 0
+      ntht = 0
       !
    END SUBROUTINE init_doloop
 
-- 
GitLab