From 4376cc85ce65ebe9acc34aa486a2ad60fa138933 Mon Sep 17 00:00:00 2001
From: Lionel GUEZ <guez@lmd.ipsl.fr>
Date: Mon, 3 Mar 2025 15:37:57 +0100
Subject: [PATCH] Use `copy_max_radius` instead of re-computing it

---
 Inst_eddies/get_var.f90 | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/Inst_eddies/get_var.f90 b/Inst_eddies/get_var.f90
index daec1a71..7dc690b3 100644
--- a/Inst_eddies/get_var.f90
+++ b/Inst_eddies/get_var.f90
@@ -17,13 +17,12 @@ contains
     use netcdf95, only: nf95_inq_varid, nf95_gunp_var
 
     use config_m, only: max_radius
-    use read_grid_inst_eddies_m, only: nlon
+    use read_grid_inst_eddies_m, only: nlon, copy_max_radius
 
     logical, intent(in):: periodic ! grid is periodic in longitude
 
-    real, intent(out):: values(1 - merge(max_radius(1), 0, periodic):, :)
-    ! (1 - merge(max_radius(1), 0, periodic):nlon + merge(max_radius(1),
-    ! 0, periodic), nlat)
+    real, intent(out):: values(1 - copy_max_radius:, :)
+    ! (1 - copy_max_radius:nlon + copy_max_radius, nlat)
     ! ssh, u or v. We cannot place this argument first because the
     ! declaration references periodic.
 
-- 
GitLab