From 377fe5ce557d984b9b7675bd32f5bfc37df92122 Mon Sep 17 00:00:00 2001
From: Philippe WAUTELET <philippe.wautelet@aero.obs-mip.fr>
Date: Tue, 16 May 2023 10:49:39 +0200
Subject: [PATCH] Philippe 16/05/2023: MNM_MEM_POSITION_PIN / MNH_MEM_RELEASE:
 provide CNAME optional dummy argument + correct some related small problems

---
 src/LIB/SURCOUCHE/src/mode_exchange_ll.f90 |   6 +-
 src/MNH/advec_4th_order_aux.f90            |   3 -
 src/MNH/advec_ppm_algo.f90                 |   4 +-
 src/MNH/advection_metsv.f90                |   4 +-
 src/MNH/advection_uvw.f90                  |   4 +-
 src/MNH/advecuvw_4th.f90                   |   4 +-
 src/MNH/advecuvw_rk.f90                    |   4 +-
 src/MNH/advecuvw_weno_k.f90                |  12 +--
 src/MNH/bl89.f90                           |   4 +-
 src/MNH/condensation.f90                   |   6 +-
 src/MNH/conjgrad.f90                       |   4 +-
 src/MNH/conresol.f90                       |   4 +-
 src/MNH/conresolz.f90                      |   4 +-
 src/MNH/dotprod.f90                        |   4 +-
 src/MNH/emoist.f90                         |   4 +-
 src/MNH/etheta.f90                         |   4 +-
 src/MNH/flat_inv.f90                       |   4 +-
 src/MNH/flat_invz.f90                      |   4 +-
 src/MNH/gdiv.f90                           |   4 +-
 src/MNH/gradient_m.f90                     |  14 +--
 src/MNH/gradient_u.f90                     |  12 +--
 src/MNH/gradient_v.f90                     |  12 +--
 src/MNH/gradient_w.f90                     |  12 +--
 src/MNH/gravity.f90                        |   6 +-
 src/MNH/gravity_impl.f90                   |   4 +-
 src/MNH/ground_paramn.f90                  |   6 +-
 src/MNH/ice4_fast_rg.f90                   |   4 +-
 src/MNH/ice4_fast_rs.f90                   |   4 +-
 src/MNH/ice4_rimltc.f90                    |   4 +-
 src/MNH/ice4_rrhong.f90                    |   4 +-
 src/MNH/ice4_sedimentation_split.f90       |   8 +-
 src/MNH/ice4_tendencies.f90                |   4 +-
 src/MNH/ice_adjust.f90                     |   4 +-
 src/MNH/mass_leak.f90                      |   4 +-
 src/MNH/mode_prandtl.f90                   | 119 +++++++++++----------
 src/MNH/modeln.f90                         |  20 ++--
 src/MNH/p_abs.f90                          |   4 +-
 src/MNH/ppm.f90                            |  38 +++----
 src/MNH/prandtl.f90                        |   4 +-
 src/MNH/pressurez.f90                      |   4 +-
 src/MNH/rain_ice.f90                       |   8 +-
 src/MNH/rain_ice_fast_rh.f90               |   2 +-
 src/MNH/rain_ice_nucleation.f90            |   8 +-
 src/MNH/rain_ice_red.f90                   |  10 +-
 src/MNH/rain_ice_sedimentation_split.f90   |   4 +-
 src/MNH/resolved_cloud.f90                 |   4 +-
 src/MNH/richardson.f90                     |   4 +-
 src/MNH/slow_terms.f90                     |   6 +-
 src/MNH/sources_neg_correct.f90            |   6 +-
 src/MNH/tke_eps_sources.f90                |   6 +-
 src/MNH/tridiag_thermo.f90                 |   4 +-
 src/MNH/tridiag_tke.f90                    |   4 +-
 src/MNH/tridiag_w.f90                      |   4 +-
 src/MNH/tridiag_wind.f90                   |   4 +-
 src/MNH/turb.f90                           |  26 ++---
 src/MNH/turb_hor_dyn_corr.f90              |   6 +-
 src/MNH/turb_hor_splt.f90                  |   8 +-
 src/MNH/turb_hor_sv_flux.f90               |   4 +-
 src/MNH/turb_hor_thermo_corr.f90           |   4 +-
 src/MNH/turb_hor_thermo_flux.f90           |   4 +-
 src/MNH/turb_hor_tke.f90                   |   4 +-
 src/MNH/turb_hor_uv.f90                    |   6 +-
 src/MNH/turb_hor_uw.f90                    |   4 +-
 src/MNH/turb_hor_vw.f90                    |   4 +-
 src/MNH/turb_ver.f90                       |   4 +-
 src/MNH/turb_ver_dyn_flux.f90              |   4 +-
 src/MNH/turb_ver_thermo_corr.f90           |   4 +-
 src/MNH/turb_ver_thermo_flux.f90           |   6 +-
 src/MNH/zdiffusetup.f90                    |   2 +-
 src/MNH/zsolver.f90                        |   4 +-
 src/MNH/zsolver_inv.f90                    |   4 +-
 71 files changed, 276 insertions(+), 274 deletions(-)

diff --git a/src/LIB/SURCOUCHE/src/mode_exchange_ll.f90 b/src/LIB/SURCOUCHE/src/mode_exchange_ll.f90
index 3a832a232..e8409c572 100644
--- a/src/LIB/SURCOUCHE/src/mode_exchange_ll.f90
+++ b/src/LIB/SURCOUCHE/src/mode_exchange_ll.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1998-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1998-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -2504,7 +2504,7 @@ INTEGER                                               :: NB_REQ,NFIRST_REQ_RECV
   IBUFFSIZE = IBUFFSIZE * (NKMAX_TMP_ll + 2 * JPVEXT)
 !
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'SEND_RECV_FIELD_DEVICE' )
 
   IF ( .NOT. LMNH_MPI_BSEND) THEN
     CALL MNH_MEM_GET( TZBUFFER, IBUFFSIZE, ISENDNB + IRECVNB )
@@ -2735,7 +2735,7 @@ INTEGER                                               :: NB_REQ,NFIRST_REQ_RECV
   ITAGOFFSET = MOD((ITAGOFFSET + NNEXTTAG), NMAXTAG)
 !
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'SEND_RECV_FIELD_DEVICE' )
 
 !$acc end data
 !
diff --git a/src/MNH/advec_4th_order_aux.f90 b/src/MNH/advec_4th_order_aux.f90
index 9838c4762..c0e5a6e63 100644
--- a/src/MNH/advec_4th_order_aux.f90
+++ b/src/MNH/advec_4th_order_aux.f90
@@ -126,9 +126,6 @@ USE MODD_CONF
 USE MODE_DEVICE
 #endif
 use mode_ll,          only: GET_INDICE_ll, LWEST_ll, LEAST_ll, LNORTH_ll, LSOUTH_ll
-#ifdef MNH_OPENACC
-USE MODE_MNH_ZWORK,   ONLY: MNH_MEM_GET, MNH_MEM_POSITION_PIN, MNH_MEM_RELEASE
-#endif
 use mode_mppdb
 #ifdef MNH_OPENACC
 use mode_msg
diff --git a/src/MNH/advec_ppm_algo.f90 b/src/MNH/advec_ppm_algo.f90
index c26b3e092..957e9e8f2 100644
--- a/src/MNH/advec_ppm_algo.f90
+++ b/src/MNH/advec_ppm_algo.f90
@@ -250,7 +250,7 @@ CASE('PPM_01')
 !
 #ifdef MNH_OPENACC
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'ADVEC_PPM_ALGO' )
 
   CALL MNH_MEM_GET( ZPPM, SIZE( PSRC, 1 ), SIZE( PSRC, 2 ), SIZE( PSRC, 3 ) )
 
@@ -358,7 +358,7 @@ CASE('PPM_01')
 
 #ifdef MNH_OPENACC
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ADVEC_PPM_ALGO' )
 #endif
 !
 ! monotonic scheme (Skamarock notation)
diff --git a/src/MNH/advection_metsv.f90 b/src/MNH/advection_metsv.f90
index faab6f654..a54dc3d1a 100644
--- a/src/MNH/advection_metsv.f90
+++ b/src/MNH/advection_metsv.f90
@@ -385,7 +385,7 @@ allocate( ZLS          ( JIU,JJU,JKU )               )
 allocate( ZCPH         ( JIU,JJU,JKU )               )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ADVECTION_METSV' )
 
 CALL MNH_MEM_GET( ZRUCPPM      , JIU, JJU, JKU               )
 CALL MNH_MEM_GET( ZRVCPPM      , JIU, JJU, JKU               )
@@ -1134,7 +1134,7 @@ deallocate ( ZRUCPPM, ZRVCPPM, ZRWCPPM, ZCFLU, ZCFLV, ZCFLW, ZCFL, ZTH,
             ZT, ZEXN, ZLV, ZLS, ZCPH                                                          )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ADVECTION_METSV' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/advection_uvw.f90 b/src/MNH/advection_uvw.f90
index c8ad50efa..e34a11c7a 100644
--- a/src/MNH/advection_uvw.f90
+++ b/src/MNH/advection_uvw.f90
@@ -252,7 +252,7 @@ ALLOCATE( ZMYM_RHODJ( IIU,IJU,IKU ) )
 ALLOCATE( ZMZM_RHODJ( IIU,IJU,IKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ADVECTION_UVW' )
 
 CALL MNH_MEM_GET( ZRUT,       IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZRVT,       IIU, IJU, IKU )
@@ -504,7 +504,7 @@ DEALLOCATE(zrut, zrvt, zrwt, zruct, zrvct, zrwct, zu, zv, zw,                &
            zmxm_rhodj, zmym_rhodj, zmzm_rhodj )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ADVECTION_UVW')
 #endif
 
 !$acc end data
diff --git a/src/MNH/advecuvw_4th.f90 b/src/MNH/advecuvw_4th.f90
index 2cca13537..0c57d7176 100644
--- a/src/MNH/advecuvw_4th.f90
+++ b/src/MNH/advecuvw_4th.f90
@@ -214,7 +214,7 @@ IJU = SIZE( PUT, 2 )
 IKU = SIZE( PUT, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ADVECUVW_4TH' )
 
 CALL MNH_MEM_GET( ZMEANX, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZMEANY, IIU, IJU, IKU )
@@ -408,7 +408,7 @@ PRWS(:,:,:) = PRWS(:,:,:) - ZTEMP4
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ADVECUVW_4TH' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/advecuvw_rk.f90 b/src/MNH/advecuvw_rk.f90
index c46759984..18bbbffa4 100644
--- a/src/MNH/advecuvw_rk.f90
+++ b/src/MNH/advecuvw_rk.f90
@@ -302,7 +302,7 @@ ALLOCATE(ZBUT(ISPL-1,ISPL-1))
 ALLOCATE(ZBUTS(ISPL))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ADVECUVW_RK' )
 
 CALL MNH_MEM_GET( ZUT, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZVT, IIU, IJU, IKU )
@@ -673,7 +673,7 @@ CALL DEL_HALO2_ll(TZHALO2MT_ll)
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ADVECUVW_RK' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/advecuvw_weno_k.f90 b/src/MNH/advecuvw_weno_k.f90
index e438471e2..0dad7467c 100644
--- a/src/MNH/advecuvw_weno_k.f90
+++ b/src/MNH/advecuvw_weno_k.f90
@@ -158,7 +158,7 @@ allocate( ZMEAN(IIU, IJU, IKU) )
 allocate( ZWORK(IIU, IJU, IKU) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ADVECUVW_WENO_K' )
 
 CALL MNH_MEM_GET( ZMEAN, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZWORK, IIU, IJU, IKU )
@@ -343,7 +343,7 @@ CASE(3) ! WENO 3
   PRWS = PRWS - DZM(WENO_K_2_WZ(PWT,MZF(PRWCT)))
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'ADVECUVW_WENO_K WENO3' )
 
   CALL MNH_MEM_GET( ZFPOS1, IIU, IJU, IKU )
   CALL MNH_MEM_GET( ZFPOS2, IIU, IJU, IKU )
@@ -466,7 +466,7 @@ CASE(3) ! WENO 3
 !$acc end kernels
 !
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ADVECUVW_WENO_K WENO3' )
 #endif
 !
 !
@@ -530,7 +530,7 @@ CASE(5) ! WENO 5
   PRWS = PRWS - DZM(ZMEAN)
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'ADVECUVW_WENO_K WENO5' )
 
   CALL MNH_MEM_GET( ZFPOS1, IIU, IJU, IKU )
   CALL MNH_MEM_GET( ZFPOS2, IIU, IJU, IKU )
@@ -690,7 +690,7 @@ CASE(5) ! WENO 5
 !$acc end kernels
 !
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ADVECUVW_WENO_K WENO5')
 #endif
 !
 !
@@ -702,7 +702,7 @@ END SELECT
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since beginning of subroutine
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ADVECUVW_WENO_K' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/bl89.f90 b/src/MNH/bl89.f90
index dbd82b24e..6aa37569a 100644
--- a/src/MNH/bl89.f90
+++ b/src/MNH/bl89.f90
@@ -213,7 +213,7 @@ if ( krr > 0 ) &
   allocate( zsum     (size( prm, 1 )   * size( prm, 2 ),   size( prm, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'BL89' )
 
 CALL MNH_MEM_GET( zvpt,        IIU * IJU, IKT )
 CALL MNH_MEM_GET( zdeltvpt,    IIU * IJU, IKT )
@@ -581,7 +581,7 @@ end if
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'BL89')
 #endif
 
 !$acc end data
diff --git a/src/MNH/condensation.f90 b/src/MNH/condensation.f90
index d4ca85714..d4bc25034 100644
--- a/src/MNH/condensation.f90
+++ b/src/MNH/condensation.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 2002-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2002-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -341,7 +341,7 @@ allocate( JKMK(kku) )
 
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'CONDENSATION' )
 
 CALL MNH_MEM_GET( ztlk,  kiu, kju, kku )
 CALL MNH_MEM_GET( zrt,   kiu, kju, kku )
@@ -724,7 +724,7 @@ deallocate( ZGAUTCP, ZGAUCP, ZCRIAUTIP, ZAUTIP, ZGAUTIP, ZGAUIP, INQ1P, ZINCP, Z
 deallocate( JKPK,JKMK )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'CONDENSATION' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/conjgrad.f90 b/src/MNH/conjgrad.f90
index 4db68c47a..ac95a2f41 100644
--- a/src/MNH/conjgrad.f90
+++ b/src/MNH/conjgrad.f90
@@ -258,7 +258,7 @@ JJU =  size(PPHI, 2 )
 JKU =  size(PPHI, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'CONJGRAD' )
 
 CALL MNH_MEM_GET( ZDELTA, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZP,     JIU, JJU, JKU )
@@ -348,7 +348,7 @@ PPHI(:,:,:) = PPHI(:,:,:) + ZLAMBDA * ZP(:,:,:)
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'CONJGRAD' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/conresol.f90 b/src/MNH/conresol.f90
index 51bb0bb57..67c45cf3e 100644
--- a/src/MNH/conresol.f90
+++ b/src/MNH/conresol.f90
@@ -246,7 +246,7 @@ JJU =  size(PPHI, 2 )
 JKU =  size(PPHI, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'CONRESOL' )
 
 CALL MNH_MEM_GET( ZDELTA,   JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZKSI,     JIU, JJU, JKU )
@@ -324,7 +324,7 @@ END DO              ! end of the loop for the iterative solver
 !
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'CONRESOL' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/conresolz.f90 b/src/MNH/conresolz.f90
index 7e7f5ac60..5c6e732cd 100644
--- a/src/MNH/conresolz.f90
+++ b/src/MNH/conresolz.f90
@@ -257,7 +257,7 @@ JJU =  size(PPHI, 2 )
 JKU =  size(PPHI, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN ( 'CONRESOLZ' )
 
 CALL MNH_MEM_GET( ZDELTA   , JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZKSI     , JIU, JJU, JKU )
@@ -356,7 +356,7 @@ END DO              ! end of the loop for the iterative solver
 !
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'CONRESOLZ' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/dotprod.f90 b/src/MNH/dotprod.f90
index 3b144b8c7..6db0b3dea 100644
--- a/src/MNH/dotprod.f90
+++ b/src/MNH/dotprod.f90
@@ -179,7 +179,7 @@ ENDIF
 #ifndef MNH_OPENACC
 ALLOCATE(ZDOTPROD(ILBXB:ILBXE,ILBYB:ILBYE))
 #else
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'DOTPROD' )
 CALL MNH_MEM_GET(ZDOTPROD, ILBXB,ILBXE ,ILBYB,ILBYE )
 #endif
 !$acc kernels present(ZDOTPROD)
@@ -199,7 +199,7 @@ PDOTPROD = SUM_DD_R2_ll_DEVICE(ZDOTPROD)
 #ifndef MNH_OPENACC
 DEALLOCATE(ZDOTPROD)
 #else
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'DOTPROD' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/emoist.f90 b/src/MNH/emoist.f90
index 40fe38c23..84f2b0763 100644
--- a/src/MNH/emoist.f90
+++ b/src/MNH/emoist.f90
@@ -158,7 +158,7 @@ allocate( za  (JIU,JJU,JKU) )
 allocate( zrw (JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'EMOIST' )
 
 CALL MNH_MEM_GET( za,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zrw, JIU, JJU, JKU )
@@ -273,7 +273,7 @@ end if
 deallocate( za, zrw )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'EMOIST' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/etheta.f90 b/src/MNH/etheta.f90
index 8768a94d1..a1b332e62 100644
--- a/src/MNH/etheta.f90
+++ b/src/MNH/etheta.f90
@@ -158,7 +158,7 @@ allocate( za  ( size( pthlm, 1 ), size( pthlm, 2 ), size( pthlm, 3 ) ) )
 allocate( zrw ( size( pthlm, 1 ), size( pthlm, 2 ), size( pthlm, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ETHETA' )
 
 CALL MNH_MEM_GET( za  , size( pthlm, 1 ), size( pthlm, 2 ), size( pthlm, 3 ) )
 CALL MNH_MEM_GET( zrw , size( pthlm, 1 ), size( pthlm, 2 ), size( pthlm, 3 ) )
@@ -256,7 +256,7 @@ end if
 deallocate (za, zrw)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ETHETA' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/flat_inv.f90 b/src/MNH/flat_inv.f90
index 5ac8c5c8e..e1408a5b4 100644
--- a/src/MNH/flat_inv.f90
+++ b/src/MNH/flat_inv.f90
@@ -291,7 +291,7 @@ IF (.NOT. L2D) THEN
 END IF
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'FLAT_INV' )
 
 CALL MNH_MEM_GET( ZY,  SIZE( PY, 1 ),  SIZE( PY, 2 ),  SIZE( PY, 3 )  )
 CALL MNH_MEM_GET( ZAF, SIZE( PBF, 1 ), SIZE( PBF, 2 ), SIZE( PBF, 3 ) )
@@ -686,7 +686,7 @@ DEALLOCATE(ZBETX)
 DEALLOCATE(ZGAM)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'FLAT_INV' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/flat_invz.f90 b/src/MNH/flat_invz.f90
index f1efeaa09..d430bd07f 100644
--- a/src/MNH/flat_invz.f90
+++ b/src/MNH/flat_invz.f90
@@ -379,7 +379,7 @@ SUBROUTINE FLAT_INVZ(HLBCX,HLBCY,PDXHATM,PDYHATM,PRHOM,PAF,PBF,PCF,   &
   END IF !  NZ_SPLITTING
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'FLAT_INVZ' )
 
   CALL MNH_MEM_GET( ZY_B, SIZE( PY, 1 ),  SIZE( PY, 2 ),  SIZE( PY, 3 )  )
   CALL MNH_MEM_GET( ZAF,  SIZE( PBF, 1 ), SIZE( PBF, 2 ), SIZE( PBF, 3 ) )
@@ -1215,7 +1215,7 @@ CALL PRINT_MSG( NVERB_WARNING, 'GEN', 'FLAT_INVZ', 'L2D=T not tested' )
   END IF
 #else
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'FLAT_INVZ' )
 #endif
   !JUAN SCALASCA TEST
   ! CALL MPI_BARRIER(NTRANS_COM, IERROR)
diff --git a/src/MNH/gdiv.f90 b/src/MNH/gdiv.f90
index 445c1d908..fcb763842 100644
--- a/src/MNH/gdiv.f90
+++ b/src/MNH/gdiv.f90
@@ -481,7 +481,7 @@ ALLOCATE(ZUC(IIU,IJU,IKU),ZVC(IIU,IJU,IKU),ZWC(IIU,IJU,IKU))
 ALLOCATE(Z1(IIU,IJU,IKU),Z2(IIU,IJU,IKU),Z3(IIU,IJU,IKU))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GDIV' )
 
 CALL MNH_MEM_GET( ZUC, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZVC, IIU, IJU, IKU )
@@ -677,7 +677,7 @@ DEALLOCATE( ZUC, ZVC, ZWC, Z1, Z2, Z3 )
 #else
 !$acc end data
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GDIV' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/gradient_m.f90 b/src/MNH/gradient_m.f90
index 15ced8198..2b558170c 100644
--- a/src/MNH/gradient_m.f90
+++ b/src/MNH/gradient_m.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -306,7 +306,7 @@ IJU = SIZE( PA, 2 )
 IKU = SIZE( PA, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GX_M_M' )
 
 CALL MNH_MEM_GET( ZTMP1, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZTMP2, IIU, IJU, IKU )
@@ -343,7 +343,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GX_M_M' )
 
 !----------------------------------------------------------------------------
 !
@@ -482,7 +482,7 @@ IJU = SIZE( PA, 2 )
 IKU = SIZE( PA, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GY_M_M' )
 
 CALL MNH_MEM_GET( ZTMP1, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZTMP2, IIU, IJU, IKU )
@@ -520,7 +520,7 @@ ENDIF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GY_M_M' )
 
 !----------------------------------------------------------------------------
 !
@@ -644,7 +644,7 @@ IJU = SIZE( PA, 2 )
 IKU = SIZE( PA, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GZ_M_M' )
 
 CALL MNH_MEM_GET( ZTMP1, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZTMP2, IIU, IJU, IKU )
@@ -665,7 +665,7 @@ CALL MZF_DEVICE( ZTMP2(:,:,:), PGZ_M_M(:,:,:) )
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GZ_M_M' )
 
 !----------------------------------------------------------------------------
 !
diff --git a/src/MNH/gradient_u.f90 b/src/MNH/gradient_u.f90
index 57d1f6c41..8e65513d3 100644
--- a/src/MNH/gradient_u.f90
+++ b/src/MNH/gradient_u.f90
@@ -224,7 +224,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GX_U_M' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -271,7 +271,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GX_U_M' )
 
 !$acc end data
 
@@ -419,7 +419,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GY_U_UV' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -474,7 +474,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GY_U_UV' )
 
 !$acc end data
 
@@ -600,7 +600,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GZ_U_UW' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -620,7 +620,7 @@ PGZ_U_UW_DEVICE(:,:,:)= ZTMP1_DEVICE(:,:,:) / ZTMP2_DEVICE(:,:,:)
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GZ_U_UW' )
 
 !$acc end data
 
diff --git a/src/MNH/gradient_v.f90 b/src/MNH/gradient_v.f90
index 57ebbd0d9..2daf81dcd 100644
--- a/src/MNH/gradient_v.f90
+++ b/src/MNH/gradient_v.f90
@@ -225,7 +225,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GY_V_M' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -273,7 +273,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GY_V_M' )
 
 !$acc end data
 
@@ -418,7 +418,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GX_V_UV' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -474,7 +474,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GX_V_UV' )
 
 !$acc end data
 
@@ -602,7 +602,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GZ_V_VW' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -622,7 +622,7 @@ PGZ_V_VW_DEVICE(:,:,:)= ZTMP1_DEVICE(:,:,:) / ZTMP2_DEVICE(:,:,:)
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GZ_V_VW' )
 
 !$acc end data
 
diff --git a/src/MNH/gradient_w.f90 b/src/MNH/gradient_w.f90
index aa095ecb9..923891109 100644
--- a/src/MNH/gradient_w.f90
+++ b/src/MNH/gradient_w.f90
@@ -200,7 +200,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GZ_W_M' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -220,7 +220,7 @@ PGZ_W_M_DEVICE(:,:,:)= ZTMP1_DEVICE(:,:,:)/ZTMP2_DEVICE(:,:,:)
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GZ_W_M' )
 
 !$acc end data
 
@@ -354,7 +354,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GX_W_UW' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -394,7 +394,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GX_W_UW' )
 
 !$acc end data
 
@@ -529,7 +529,7 @@ JJU =  size(pa, 2 )
 JKU =  size(pa, 3 )
 
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GY_W_VW' )
 
 CALL MNH_MEM_GET( ztmp1_device, JIU, JJU, JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU, JJU, JKU )
@@ -569,7 +569,7 @@ END IF
 !$acc end data
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GY_W_VW' )
 
 !$acc end data
 
diff --git a/src/MNH/gravity.f90 b/src/MNH/gravity.f90
index cb778ec60..9ca8f1c82 100644
--- a/src/MNH/gravity.f90
+++ b/src/MNH/gravity.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -167,7 +167,7 @@ allocate( zwork1(IIU, IJU, IKU ) )
 allocate( zwork2(IIU, IJU, IKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GRAVITY' )
 
 CALL MNH_MEM_GET( zwork1, IIU, IJU, IKU )
 CALL MNH_MEM_GET( zwork2, IIU, IJU, IKU )
@@ -269,7 +269,7 @@ END IF
 deallocate( zwork1, zwork2 )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GRAVITY' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/gravity_impl.f90 b/src/MNH/gravity_impl.f90
index 6ae2c3430..9d9104d53 100644
--- a/src/MNH/gravity_impl.f90
+++ b/src/MNH/gravity_impl.f90
@@ -160,7 +160,7 @@ allocate( zth      (JIU, JJU, JKU ) )
 allocate( zr       (JIU, JJU, JKU, JRU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GRAVITY_IMPL' )
 
 CALL MNH_MEM_GET( zrws_grav, JIU, JJU, JKU )
 CALL MNH_MEM_GET( zth,       JIU, JJU, JKU )
@@ -216,7 +216,7 @@ end if
 DEALLOCATE( zrws_grav, zth, zr )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GRAVITY_IMPL' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/ground_paramn.f90 b/src/MNH/ground_paramn.f90
index 292f3ee77..17d20feba 100644
--- a/src/MNH/ground_paramn.f90
+++ b/src/MNH/ground_paramn.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1995-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1995-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -394,7 +394,7 @@ allocate( ZUA   (SIZE(PSFTH,1),SIZE(PSFTH,2))  )
 allocate( ZVA   (SIZE(PSFTH,1),SIZE(PSFTH,2))  )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'GROUND_PARAM_n' )
 
 CALL MNH_MEM_GET( ZUA, SIZE(PSFTH,1), SIZE(PSFTH,2) )
 CALL MNH_MEM_GET( ZVA, SIZE(PSFTH,1), SIZE(PSFTH,2) )
@@ -863,7 +863,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'GROUND_PARAM_n' )
 #endif
 !
 !==================================================================================
diff --git a/src/MNH/ice4_fast_rg.f90 b/src/MNH/ice4_fast_rg.f90
index 9156a05f0..a1329e53d 100644
--- a/src/MNH/ice4_fast_rg.f90
+++ b/src/MNH/ice4_fast_rg.f90
@@ -251,7 +251,7 @@ allocate( zrdryg_init( isize ) )
 allocate( zrwetg_init( isize ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_FAST_RG' )
 
 CALL MNH_MEM_GET( I1,    ISIZE )
 CALL MNH_MEM_GET( IVEC1, ISIZE )
@@ -851,7 +851,7 @@ deallocate( ivec1       )
 deallocate( i1          )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ICE4_FAST_RG' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/ice4_fast_rs.f90 b/src/MNH/ice4_fast_rs.f90
index 621ad6173..8ffab3db7 100644
--- a/src/MNH/ice4_fast_rs.f90
+++ b/src/MNH/ice4_fast_rs.f90
@@ -212,7 +212,7 @@ allocate( zzw6        ( isize ) )
 allocate( zfreez_rate ( isize ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_FAST_RS' )
 
 CALL MNH_MEM_GET( I1,    ISIZE )
 CALL MNH_MEM_GET( IVEC1, ISIZE )
@@ -763,7 +763,7 @@ deallocate( ivec1       )
 deallocate( i1          )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ICE4_FAST_RS' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/ice4_rimltc.f90 b/src/MNH/ice4_rimltc.f90
index 650e93948..b07f200df 100644
--- a/src/MNH/ice4_rimltc.f90
+++ b/src/MNH/ice4_rimltc.f90
@@ -108,7 +108,7 @@ isize = Size( pcompute )
 allocate( zmask(isize) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_RIMLTC' )
 
 CALL MNH_MEM_GET( zmask, isize )
 
@@ -145,7 +145,7 @@ ENDDO
 
 #ifdef MNH_OPENACC
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ICE4_RIMLTC' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/ice4_rrhong.f90 b/src/MNH/ice4_rrhong.f90
index 042c9ed3f..841a0da45 100644
--- a/src/MNH/ice4_rrhong.f90
+++ b/src/MNH/ice4_rrhong.f90
@@ -108,7 +108,7 @@ isize = Size( prrt )
 allocate( zmask(isize) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_RRHONG' )
 
 CALL MNH_MEM_GET( zmask, isize )
 
@@ -144,7 +144,7 @@ ENDDO
 
 #ifdef MNH_OPENACC
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ICE4_RRHONG' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
diff --git a/src/MNH/ice4_sedimentation_split.f90 b/src/MNH/ice4_sedimentation_split.f90
index de1f75776..38f6ad05d 100644
--- a/src/MNH/ice4_sedimentation_split.f90
+++ b/src/MNH/ice4_sedimentation_split.f90
@@ -224,7 +224,7 @@ allocate( zrgt   (size( prhodref, 1 ), size( prhodref, 2 ), size( prhodref, 3 )
 allocate( zrht   (size( prhodref, 1 ), size( prhodref, 2 ), size( prhodref, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_SEDIMENTATION_SPLIT' )
 
 CALL MNH_MEM_GET( zconc_tmp, KIT , KJT )
 
@@ -469,7 +469,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ICE4_SEDIMENTATION_SPLIT' )
 #endif
 
 !$acc end data
@@ -576,7 +576,7 @@ allocate( zremaint(size( prhodref, 1 ), size( prhodref, 2 ) ) )
 allocate( zwsed(size( prhodref, 1 ), size( prhodref, 2 ), 0 : size( prhodref, 3 ) + 1 ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'INTERNAL_SEDIM_SPLI' )
 
 CALL MNH_MEM_GET( i1, kit * kjt * kkt )
 CALL MNH_MEM_GET( i2, kit * kjt * kkt )
@@ -810,7 +810,7 @@ deallocate( i2 )
 deallocate( i1 )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'INTERNAL_SEDIM_SPLI' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/ice4_tendencies.f90 b/src/MNH/ice4_tendencies.f90
index 7d41eef25..ad36fcb3b 100644
--- a/src/MNH/ice4_tendencies.f90
+++ b/src/MNH/ice4_tendencies.f90
@@ -423,7 +423,7 @@ allocate( zrgt3d(kit, kjt, kkt ) )
 allocate( zrht3d(kit, kjt, kkt ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE4_TENDENCIES' )
 
 allocate( gldcompute(isize ) )
 
@@ -1008,7 +1008,7 @@ deallocate( zwetg    )
 deallocate( gldcompute )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ICE4_TENDENCIES' )
 
 deallocate( gldcompute )
 #endif
diff --git a/src/MNH/ice_adjust.f90 b/src/MNH/ice_adjust.f90
index 77b7e509c..d0592d251 100644
--- a/src/MNH/ice_adjust.f90
+++ b/src/MNH/ice_adjust.f90
@@ -387,7 +387,7 @@ allocate( zhr    (IIU, IJU, IKU ) )
 allocate( ZTEMP_BUD (IIU, IJU, IKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ICE_ADJUST' )
 
 CALL MNH_MEM_GET( gtemp  , IIU, IJU, IKU )
 CALL MNH_MEM_GET( zsigs  , IIU, IJU, IKU )
@@ -711,7 +711,7 @@ end if
 deallocate( gtemp, zsigs, zsrcs, zt, zrv, zrc, zri, zcph, zlv, zls, zw1, zw2, zcriaut, zhcf, zhr , ZTEMP_BUD )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ICE_ADJUST' )
 #endif
 !------------------------------------------------------------------------------
 !
diff --git a/src/MNH/mass_leak.f90 b/src/MNH/mass_leak.f90
index 5dbbe0e5b..1196ac5bc 100644
--- a/src/MNH/mass_leak.f90
+++ b/src/MNH/mass_leak.f90
@@ -202,7 +202,7 @@ IF( HLBCY(1) /= 'CYCL' ) THEN
 END IF
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'MASS_LEAK' )
 IF( HLBCX(1) /= 'CYCL' ) THEN
    CALL MNH_MEM_GET(ZLEAK_W_2D , IIB  ,IIB   , IJB,IJE )
    CALL MNH_MEM_GET(ZLEAK_E_2D , IIE+1,IIE+1 , IJB,IJE )
@@ -332,7 +332,7 @@ IF( HLBCY(1) /= 'CYCL' ) THEN
 END IF
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'MASS_LEAK' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/mode_prandtl.f90 b/src/MNH/mode_prandtl.f90
index e8e8bb1cb..126d3d898 100644
--- a/src/MNH/mode_prandtl.f90
+++ b/src/MNH/mode_prandtl.f90
@@ -47,7 +47,7 @@ REAL, DIMENSION(:,:,:), pointer,contiguous ::  ZCOEF
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'SMOOTH_TURB_FUNCT' )
 
 CALL MNH_MEM_GET( ZCOEF , SIZE(PF,1),SIZE(PF,2),SIZE(PF,3) )
 #endif
@@ -71,7 +71,7 @@ PF(:,:,:) =     ZCOEF(:,:,:)   * PF    &
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'SMOOTH_TURB_FUNCT' )
 #endif
 
 END SUBROUTINE SMOOTH_TURB_FUNCT
@@ -119,7 +119,7 @@ allocate( zw2      ( size( predth1, 1 ), size( predth1, 2 ), size( predth1, 3 )
 allocate( gphi3logic( size( predth1, 1 ), size( predth1, 2 ), size( predth1, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PHI3' )
 
 CALL MNH_MEM_GET( zw1       , JIU,JJU,JKU )
 CALL MNH_MEM_GET( zw2       , JIU,JJU,JKU )
@@ -197,7 +197,7 @@ PPHI3(:,:,IKE+1)=PPHI3(:,:,IKE)
 deallocate ( zw1,zw2,gphi3logic)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PHI3' )
 #endif
 
 !$acc end data
@@ -236,7 +236,7 @@ SUBROUTINE PSI_SV(PREDTH1,PREDR1,PREDS1,PRED2THS,PRED2RS,PPHI3,PPSI3,PPSI_SV)
 allocate( gpsilogic( size( pred2ths, 1 ), size( pred2ths, 2 ), size( pred2ths, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PSI_SV' )
 
 CALL MNH_MEM_GET( gpsilogic , size( pred2ths, 1 ), size( pred2ths, 2 ), size( pred2ths, 3 ) )
 #endif  
@@ -276,7 +276,7 @@ END DO
 deallocate( gpsilogic )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PSI_SV' )
 #endif
 
 !$acc end data
@@ -481,7 +481,7 @@ SUBROUTINE D_PHI3DTDZ2_O_DDTDZ(PPHI3,PREDTH1,PREDR1,PRED2TH3,PRED2THR3,PDTDZ,HTU
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_PHI3DTDZ2_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device, size( predth1, 1 ), size( predth1, 2 ), size( predth1, 3 ) )
 #endif
@@ -563,7 +563,7 @@ PD_PHI3DTDZ2_O_DDTDZ(:,:,IKE+1)=PD_PHI3DTDZ2_O_DDTDZ(:,:,IKE)
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_PHI3DTDZ2_O_DDTDZ')
 #endif
 
 !$acc end data
@@ -689,7 +689,7 @@ call Print_msg( NVERB_WARNING, 'GEN', 'M3_WTH_W2TH', 'OpenACC: not yet tested' )
 allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
- CALL MNH_MEM_POSITION_PIN() 
+ CALL MNH_MEM_POSITION_PIN( 'M3_WTH_W2TH' )
  CALL MNH_MEM_GET(ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) 
 #endif
 
@@ -717,7 +717,7 @@ PM3_WTH_W2TH(:,:,IKE+1)=PM3_WTH_W2TH(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
  !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
- CALL MNH_MEM_RELEASE()
+ CALL MNH_MEM_RELEASE( 'M3_WTH_W2TH' )
 #endif
 
 
@@ -760,7 +760,7 @@ call Print_msg( NVERB_WARNING, 'GEN', 'D_M3_WTH_W2TH_O_DDTDZ', 'OpenACC: not yet
 #ifndef MNH_OPENACC
 allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_WTH_W2TH_O_DDTDZ' )
 
 CALL MNH_MEM_GET(ztmp1_device, size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 #endif
@@ -799,7 +799,7 @@ PD_M3_WTH_W2TH_O_DDTDZ(:,:,IKE+1)=PD_M3_WTH_W2TH_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_WTH_W2TH_O_DDTDZ' )
 
 #endif
 
@@ -841,7 +841,7 @@ call Print_msg( NVERB_WARNING, 'GEN', 'M3_WTH_W2R', 'OpenACC: not yet tested' )
 #ifndef MNH_OPENACC
 allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_WTH_W2R' )
 
 CALL MNH_MEM_GET(ztmp1_device, size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 #endif
@@ -869,7 +869,7 @@ PM3_WTH_W2R(:,:,IKE+1)=PM3_WTH_W2R(:,:,IKE)
 #ifdef MNH_OPENACC
 
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_WTH_W2R' )
 
 #endif
 
@@ -913,7 +913,7 @@ call Print_msg( NVERB_WARNING, 'GEN', 'D_M3_WTH_W2R_O_DDTDZ', 'OpenACC: not yet
 allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_WTH_W2R_O_DDTDZ' )
 
 CALL MNH_MEM_GET(ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 #endif
@@ -942,7 +942,7 @@ PD_M3_WTH_W2R_O_DDTDZ(:,:,IKE+1)=PD_M3_WTH_W2R_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_WTH_W2R_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -988,7 +988,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_WTH_WR2' )
 
 CALL MNH_MEM_GET(ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 )) 
 CALL MNH_MEM_GET(ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 )) 
@@ -1029,7 +1029,7 @@ PM3_WTH_WR2(:,:,IKE+1)=PM3_WTH_WR2(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_WTH_WR2' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1078,7 +1078,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_WTH_WR2_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1121,7 +1121,7 @@ PD_M3_WTH_WR2_O_DDTDZ(:,:,IKE+1)=PD_M3_WTH_WR2_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_WTH_WR2_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1167,7 +1167,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_WTH_WTHR' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1200,7 +1200,7 @@ PM3_WTH_WTHR(:,:,IKE+1)=PM3_WTH_WTHR(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_WTH_WTHR' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1286,7 +1286,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_TH2_W2TH' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1319,7 +1319,7 @@ PM3_TH2_W2TH(:,:,IKE+1)=PM3_TH2_W2TH(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_TH2_W2TH' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1363,7 +1363,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_TH2_W2TH_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1431,7 +1431,7 @@ PD_M3_TH2_W2TH_O_DDTDZ(:,:,IKE+1)=PD_M3_TH2_W2TH_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_TH2_W2TH_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1473,7 +1473,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_TH2_WTH2' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1513,7 +1513,7 @@ PM3_TH2_WTH2(:,:,IKE+1)=PM3_TH2_WTH2(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_TH2_WTH2' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1558,7 +1558,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_TH2_WTH2_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1603,7 +1603,7 @@ PD_M3_TH2_WTH2_O_DDTDZ(:,:,IKE+1)=PD_M3_TH2_WTH2_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_TH2_WTH2_O_DDTDZ')
 #endif
 
 #ifndef MNH_OPENACC
@@ -1648,7 +1648,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_TH2_W2R' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1692,7 +1692,7 @@ PM3_TH2_W2R(:,:,IKE+1)=PM3_TH2_W2R(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_TH2_W2R' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1738,7 +1738,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_TH2_W2R_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1780,7 +1780,7 @@ PD_M3_TH2_W2R_O_DDTDZ(:,:,IKE+1)=PD_M3_TH2_W2R_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_TH2_W2R_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1823,7 +1823,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_TH2_WR2' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1867,7 +1867,7 @@ PM3_TH2_WR2(:,:,IKE+1)=PM3_TH2_WR2(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_TH2_WR2' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -1911,7 +1911,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_TH2_WR2_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -1958,7 +1958,7 @@ PD_M3_TH2_WR2_O_DDTDZ(:,:,IKE+1)=PD_M3_TH2_WR2_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_TH2_WR2_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2002,7 +2002,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_TH2_WTHR' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2035,7 +2035,7 @@ PM3_TH2_WTHR(:,:,IKE+1)=PM3_TH2_WTHR(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_TH2_WTHR' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2080,7 +2080,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_TH2_WTHR_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2114,7 +2114,7 @@ PD_M3_TH2_WTHR_O_DDTDZ(:,:,IKE+1)=PD_M3_TH2_WTHR_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_TH2_WTHR_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2156,7 +2156,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_THR_WTHR' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2189,7 +2189,7 @@ PM3_THR_WTHR(:,:,IKE+1)=PM3_THR_WTHR(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_THR_WTHR' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2233,7 +2233,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_THR_WTHR_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2266,7 +2266,7 @@ PD_M3_THR_WTHR_O_DDTDZ(:,:,IKE+1)=PD_M3_THR_WTHR_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_THR_WTHR_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2310,7 +2310,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_THR_WTH2' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2343,7 +2343,7 @@ PM3_THR_WTH2(:,:,IKE+1)=PM3_THR_WTH2(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_THR_WTH2' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2388,7 +2388,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_THR_WTH2_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2434,7 +2434,7 @@ PD_M3_THR_WTH2_O_DDTDZ(:,:,IKE+1)=PD_M3_THR_WTH2_O_DDTDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_THR_WTH2_O_DDTDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2478,7 +2478,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_THR_WTH2_O_DDRDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2514,7 +2514,7 @@ PD_M3_THR_WTH2_O_DDRDZ(:,:,IKE+1)=PD_M3_THR_WTH2_O_DDRDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_THR_WTH2_O_DDRDZ' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2557,7 +2557,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'M3_THR_W2TH' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2590,7 +2590,7 @@ PM3_THR_W2TH(:,:,IKE+1)=PM3_THR_W2TH(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'M3_THR_W2TH' )
 #endif
 
 #ifndef MNH_OPENACC
@@ -2636,7 +2636,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_THR_W2TH_O_DDTDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2681,6 +2681,11 @@ PD_M3_THR_W2TH_O_DDTDZ(:,:,IKE+1)=PD_M3_THR_W2TH_O_DDTDZ(:,:,IKE)
 
 !$acc end data
 
+#ifdef MNH_OPENACC
+!Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
+CALL MNH_MEM_RELEASE( 'D_M3_THR_W2TH_O_DDTDZ' )
+#endif
+
 #ifndef MNH_OPENACC
 END FUNCTION D_M3_THR_W2TH_O_DDTDZ
 #else
@@ -2721,7 +2726,7 @@ allocate( ztmp1_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 allocate( ztmp2_device(size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'D_M3_THR_W2TH_O_DDRDZ' )
 
 CALL MNH_MEM_GET( ztmp1_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
 CALL MNH_MEM_GET( ztmp2_device,size( pd, 1 ), size( pd, 2 ), size( pd, 3 ) )
@@ -2765,7 +2770,7 @@ PD_M3_THR_W2TH_O_DDRDZ(:,:,IKE+1)=PD_M3_THR_W2TH_O_DDRDZ(:,:,IKE)
 !$acc end data
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'D_M3_THR_W2TH_O_DDRDZ' )
 #endif
 
 #ifndef MNH_OPENACC
diff --git a/src/MNH/modeln.f90 b/src/MNH/modeln.f90
index e8530e4bc..ab883121e 100644
--- a/src/MNH/modeln.f90
+++ b/src/MNH/modeln.f90
@@ -594,7 +594,7 @@ allocate( ZRWS  (SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) )
 allocate( ZPABST(SIZE(XTHT,1),SIZE(XTHT,2),SIZE(XTHT,3)) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'MODEL_n 1')
 CALL MNH_MEM_GET( ZRUS,   SIZE( XTHT, 1 ), SIZE( XTHT, 2 ), SIZE( XTHT, 3 ) )
 CALL MNH_MEM_GET( ZRVS,   SIZE( XTHT, 1 ), SIZE( XTHT, 2 ), SIZE( XTHT, 3 ) )
 CALL MNH_MEM_GET( ZRWS,   SIZE( XTHT, 1 ), SIZE( XTHT, 2 ), SIZE( XTHT, 3 ) )
@@ -1996,7 +1996,7 @@ IF (CCLOUD /= 'NONE' .AND. CELEC == 'NONE') THEN
     ALLOCATE (ZSEA(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
     ALLOCATE (ZTOWN(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
 #else
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'MODEL_n 2')
 
     CALL MNH_MEM_GET( ZSEA,  SIZE( XRHODJ, 1 ), SIZE( XRHODJ, 2 ) )
     CALL MNH_MEM_GET( ZTOWN, SIZE( XRHODJ, 1 ), SIZE( XRHODJ, 2 ) )
@@ -2027,7 +2027,7 @@ IF (CCLOUD /= 'NONE' .AND. CELEC == 'NONE') THEN
     DEALLOCATE(ZTOWN)
     DEALLOCATE(ZSEA)
 #else
-    CALL MNH_MEM_RELEASE() !Release ZSEA and ZTOWN
+    CALL MNH_MEM_RELEASE( 'MODEL_n 2' ) !Release ZSEA and ZTOWN
 #endif
   ELSE
     CALL RESOLVED_CLOUD ( CCLOUD, CACTCCN, CSCONV, CMF_CLOUD, NRR, NSPLITR,    &
@@ -2116,7 +2116,7 @@ IF (CELEC /= 'NONE' .AND. (CCLOUD(1:3) == 'ICE')) THEN
     ALLOCATE (ZSEA(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
     ALLOCATE (ZTOWN(SIZE(XRHODJ,1),SIZE(XRHODJ,2)))
 #else
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'MODEL_n 3' )
 
     CALL MNH_MEM_GET( ZSEA,  SIZE( XRHODJ, 1 ), SIZE( XRHODJ, 2 ) )
     CALL MNH_MEM_GET( ZTOWN, SIZE( XRHODJ, 1 ), SIZE( XRHODJ, 2 ) )
@@ -2138,7 +2138,7 @@ IF (CELEC /= 'NONE' .AND. (CCLOUD(1:3) == 'ICE')) THEN
     DEALLOCATE(ZTOWN)
     DEALLOCATE(ZSEA)
 #else
-    CALL MNH_MEM_RELEASE() !Release ZSEA and ZTOWN
+    CALL MNH_MEM_RELEASE( 'MODEL_n 3' ) !Release ZSEA and ZTOWN
 #endif
   ELSE
     CALL RESOLVED_ELEC_n (CCLOUD, CSCONV, CMF_CLOUD,                     &
@@ -2252,7 +2252,7 @@ IF (LFLYER) THEN
 #ifndef MNH_OPENACC
     ALLOCATE(ZSEA(IIU,IJU))
 #else
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'MODEL_n 4' )
 
     CALL MNH_MEM_GET( ZSEA, IIU, IJU )
 #endif
@@ -2265,7 +2265,7 @@ IF (LFLYER) THEN
 #ifndef MNH_OPENACC
     DEALLOCATE(ZSEA)
 #else
-    CALL MNH_MEM_RELEASE() !Release ZSEA
+    CALL MNH_MEM_RELEASE( 'MODEL_n 4' ) !Release ZSEA
 #endif
   ELSE
     CALL AIRCRAFT_BALLOON(XTSTEP,                                             &
@@ -2295,7 +2295,7 @@ IF (LPROFILER)  THEN
 #ifndef MNH_OPENACC
     ALLOCATE(ZSEA(IIU,IJU))
 #else
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'MODEL_n 5' )
 
     CALL MNH_MEM_GET( ZSEA, IIU, IJU )
 #endif
@@ -2308,7 +2308,7 @@ IF (LPROFILER)  THEN
 #ifndef MNH_OPENACC
     DEALLOCATE(ZSEA)
 #else
-    CALL MNH_MEM_RELEASE() !Release ZSEA
+    CALL MNH_MEM_RELEASE( 'MODEL_n 5' ) !Release ZSEA
 #endif
   ELSE
     CALL PROFILER_n(XTSTEP,                                              &
@@ -2516,7 +2516,7 @@ END IF
 DEALLOCATE( ZRUS,ZRVS,ZRWS )
 DEALLOCATE( ZPABST )
 #else
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'MODEL_n 1' )
 #endif
 
 END SUBROUTINE MODEL_n
diff --git a/src/MNH/p_abs.f90 b/src/MNH/p_abs.f90
index 161759350..9e9159ed9 100644
--- a/src/MNH/p_abs.f90
+++ b/src/MNH/p_abs.f90
@@ -248,7 +248,7 @@ ALLOCATE(ZWATERMASST_2D(IIB:IIE,IJB:IJE))
 ALLOCATE (ZRTOT(IIU,IJU,IKU), ZRHOREF(IIU,IJU,IKU), ZWORK(IIU,IJU,IKU))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'P_ABS' )
 
 #ifdef MNH_COMPILER_CCE_1403 && defined(MNH_BITREP_OMP)
 CALL MNH_MEM_GET( PEXNREF_BR, IIB, IIE, IJB, IJE, IKB, IKE )
@@ -509,7 +509,7 @@ DEALLOCATE(ZMASS_O_PI_2D,ZMASSGUESS_2D,ZWATERMASST_2D)
 DEALLOCATE (ZRTOT, ZRHOREF, ZWORK)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'P_ABS' )
 #endif
 IF (MPPDB_INITIALIZED) THEN
    CALL MPPDB_CHECK(PPHIT,"P_ABS end:PPHIT")
diff --git a/src/MNH/ppm.f90 b/src/MNH/ppm.f90
index 5e170e440..414b1bcb1 100644
--- a/src/MNH/ppm.f90
+++ b/src/MNH/ppm.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -437,7 +437,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_01_X' )
 
 CALL MNH_MEM_GET( ZQL,   IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZQR,   IIU, IJU, IKU )
@@ -924,7 +924,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_01_X' )
 #endif
 
 CONTAINS
@@ -1128,7 +1128,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_01_Y' )
 
 CALL MNH_MEM_GET( ZQL,   IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZQR,   IIU, IJU, IKU )
@@ -1680,7 +1680,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_01_Y' )
 #endif
 
 CONTAINS
@@ -1878,7 +1878,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_01_Z' )
 
 CALL MNH_MEM_GET( ZQL,   IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZQR,   IIU, IJU, IKU )
@@ -2139,7 +2139,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_01_Z' )
 #endif
 
 CONTAINS
@@ -2328,7 +2328,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S0_X' )
 
 CALL MNH_MEM_GET( ZFPOS,    IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZFNEG,    IIU, IJU, IKU )
@@ -2621,7 +2621,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S0_X' )
 #endif
 
 #ifdef MNH_OPENACC
@@ -2744,7 +2744,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S0_Y' )
 
 CALL MNH_MEM_GET( ZFPOS,    IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZFNEG,    IIU, IJU, IKU )
@@ -3044,7 +3044,7 @@ END IF !not L2D
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S0_Y' )
 #endif
 
 #ifdef MNH_OPENACC
@@ -3148,7 +3148,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S0_Z' )
 
 CALL MNH_MEM_GET( ZFPOS,    IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZFNEG,    IIU, IJU, IKU )
@@ -3269,7 +3269,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S0_Z' )
 #endif
 
 #ifdef MNH_OPENACC
@@ -3395,7 +3395,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S1_X' )
 
 CALL MNH_MEM_GET( ZPHAT, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZRUT,  IIU, IJU, IKU )
@@ -3602,7 +3602,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S1_X' )
 #endif
 
 #ifdef MNH_OPENACC
@@ -3731,7 +3731,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S1_Y' )
 
 CALL MNH_MEM_GET( ZPHAT, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZRVT,  IIU, IJU, IKU )
@@ -3941,7 +3941,7 @@ END IF !not L2D
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S1_Y' )
 #endif
 
 #ifdef MNH_OPENACC
@@ -4064,7 +4064,7 @@ iku = size( PSRC, 3 )
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PPM_S1_Z' )
 
 CALL MNH_MEM_GET( ZPHAT, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZRVT,  IIU, IJU, IKU )
@@ -4335,7 +4335,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PPM_S1_Z' )
 #endif
 
 #ifdef MNH_OPENACC
diff --git a/src/MNH/prandtl.f90 b/src/MNH/prandtl.f90
index f2cc9f810..7d1151546 100644
--- a/src/MNH/prandtl.f90
+++ b/src/MNH/prandtl.f90
@@ -337,7 +337,7 @@ allocate( zw1(JIU,JJU,JKU ) )
 allocate( zw2(JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PRANDTL' )
 
 CALL MNH_MEM_GET( zw1, JIU,JJU,JKU )
 CALL MNH_MEM_GET( zw2, JIU,JJU,JKU )
@@ -1230,7 +1230,7 @@ end if
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-call MNH_MEM_RELEASE()
+call MNH_MEM_RELEASE( 'PRANDTL' )
 #else
 DEALLOCATE(ZW1,ZW2)
 #endif
diff --git a/src/MNH/pressurez.f90 b/src/MNH/pressurez.f90
index 74f6fec9a..128661e9b 100644
--- a/src/MNH/pressurez.f90
+++ b/src/MNH/pressurez.f90
@@ -495,7 +495,7 @@ GPRVREF0 =  ( SIZE(PRVREF,1) == 0 )
 !
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'PRESSUREZ' )
 
 CALL MNH_MEM_GET( ZDV_SOURCE, IIU, IJU, IKU )
 CALL MNH_MEM_GET( ZTHETAV,    IIU, IJU, IKU )
@@ -1190,7 +1190,7 @@ IF (MPPDB_INITIALIZED) THEN
 END IF
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'PRESSUREZ' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/rain_ice.f90 b/src/MNH/rain_ice.f90
index 2c9d9a834..cbb91af2c 100644
--- a/src/MNH/rain_ice.f90
+++ b/src/MNH/rain_ice.f90
@@ -478,7 +478,7 @@ IIJKU = IIU * IJU * IKU
 ALLOCATE( I1(SIZE(PEXNREF)), I2(SIZE(PEXNREF)), I3(SIZE(PEXNREF)) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE 1' )
 
 CALL MNH_MEM_GET( I1, IIJKU )
 CALL MNH_MEM_GET( I2, IIJKU )
@@ -637,7 +637,7 @@ IF( IMICRO >= 0 ) THEN
   END IF
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE 2' )
 
   CALL MNH_MEM_GET(ZRVT,IMICRO)
   CALL MNH_MEM_GET(ZRCT,IMICRO)
@@ -1224,7 +1224,7 @@ IF( IMICRO >= 0 ) THEN
   DEALLOCATE(ZHLC_LRCLOCAL)
 #else
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'RAIN_ICE 2')
 #endif
 END IF
 !
@@ -1292,7 +1292,7 @@ DEALLOCATE ( I1,I2,I3 )
 DEALLOCATE ( GMICRO, ZRR, ZRS, ZRG, ZT )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since beginning of subroutine
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RAIN_ICE 1' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/rain_ice_fast_rh.f90 b/src/MNH/rain_ice_fast_rh.f90
index a2d969e71..83e4237fd 100644
--- a/src/MNH/rain_ice_fast_rh.f90
+++ b/src/MNH/rain_ice_fast_rh.f90
@@ -252,7 +252,7 @@ CALL MNH_MEM_GET( ZZW1,  SIZE(PRHODREF), 7 )
       ALLOCATE(IVEC2(IGWET))
 #else
       !Pin positions in the pools of MNH memory
-      CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_FAST_RG 2' )
+      CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_FAST_RH 2' )
 
       CALL MNH_MEM_GET( ZVECLBDAH, IGWET )
       CALL MNH_MEM_GET( ZVECLBDAS, IGWET )
diff --git a/src/MNH/rain_ice_nucleation.f90 b/src/MNH/rain_ice_nucleation.f90
index dbac01ac7..b96befdb0 100644
--- a/src/MNH/rain_ice_nucleation.f90
+++ b/src/MNH/rain_ice_nucleation.f90
@@ -144,7 +144,7 @@ allocate( gnegt( JIU,JJU,JKU ) )
 allocate( zw   ( JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_NUCLEATION 1' )
 
 CALL MNH_MEM_GET( i1, JIJKU )
 CALL MNH_MEM_GET( i2, JIJKU )
@@ -197,7 +197,7 @@ IF( INEGT >= 1 ) THEN
   ALLOCATE(ZSSI(INEGT))
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_NUCLEATION 2' )
 
   CALL MNH_MEM_GET( ZRVT,  INEGT )
   CALL MNH_MEM_GET( ZCIT,  INEGT )
@@ -356,7 +356,7 @@ END IF
   DEALLOCATE(ZRVT)
 #else
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'RAIN_ICE_NUCLEATION 2' )
 #endif
 END IF
 !
@@ -380,7 +380,7 @@ END IF
 deallocate (i1, i2, i3, gnegt, zw )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since beginning of subroutine
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RAIN_ICE_NUCLEATION 1' )
 #endif
 !$acc end data
 
diff --git a/src/MNH/rain_ice_red.f90 b/src/MNH/rain_ice_red.f90
index 221cd5fc7..8302bd5e8 100644
--- a/src/MNH/rain_ice_red.f90
+++ b/src/MNH/rain_ice_red.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1995-2021 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1995-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -947,7 +947,7 @@ allocate( zw_rhs(jiu, jju, jku ) )
 allocate( zw_ths(jiu, jju, jku ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_RED' )
 
 CALL MNH_MEM_GET( i1, imicro )
 CALL MNH_MEM_GET( i2, imicro )
@@ -2834,7 +2834,7 @@ ENDIF
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RAIN_ICE_RED' )
 #endif
 
 IF (MPPDB_INITIALIZED) THEN
@@ -2908,7 +2908,7 @@ CONTAINS
   allocate( zw(size( prv, 1 ), size( prv, 2 ), size( prv, 3 ) ) )
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'CORRECT_NEGATIVITIES' )
 
   CALL MNH_MEM_GET( gw, size( prv, 1 ), size( prv, 2 ), size( prv, 3 ) )
   CALL MNH_MEM_GET( zw, size( prv, 1 ), size( prv, 2 ), size( prv, 3 ) )
@@ -3018,7 +3018,7 @@ CONTAINS
 
 #ifdef MNH_OPENACC
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'CORRECT_NEGATIVITIES' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/rain_ice_sedimentation_split.f90 b/src/MNH/rain_ice_sedimentation_split.f90
index 68c2ea95d..c9478caa3 100644
--- a/src/MNH/rain_ice_sedimentation_split.f90
+++ b/src/MNH/rain_ice_sedimentation_split.f90
@@ -203,7 +203,7 @@ ALLOCATE( IG1(IIJKU), IG2(IIJKU), IG3(IIJKU) )
 ALLOCATE( IH1(IIJKU), IH2(IIJKU), IH3(IIJKU) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RAIN_ICE_SEDIMENTATION_SPLIT' )
 
 CALL MNH_MEM_GET(IC1,IIJKU)
 CALL MNH_MEM_GET(IC2,IIJKU)
@@ -739,7 +739,7 @@ DEALLOCATE(ZRAY, ZLBC, ZFSEDC,ZPRCS, ZPRRS, ZPRSS, ZPRGS, ZPRHS, ZW)
 DEALLOCATE(ZWSED)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RAIN_ICE_SEDIMENTATION_SPLIT' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/resolved_cloud.f90 b/src/MNH/resolved_cloud.f90
index 2519f66d3..071c83e1f 100644
--- a/src/MNH/resolved_cloud.f90
+++ b/src/MNH/resolved_cloud.f90
@@ -637,7 +637,7 @@ END IF
 
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RESOLVED_CLOUD' )
 
 CALL MNH_MEM_GET( LLMICRO   ,JIU,JJU,JKU )
 CALL MNH_MEM_GET( ZDZZ      ,JIU,JJU,JKU )
@@ -1341,7 +1341,7 @@ deallocate( ZDZZ )
 deallocate( LLMICRO )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RESOLVED_CLOUD' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/richardson.f90 b/src/MNH/richardson.f90
index 753d4d54a..89ea4a4b8 100644
--- a/src/MNH/richardson.f90
+++ b/src/MNH/richardson.f90
@@ -230,7 +230,7 @@ END IF
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'RICHARDSON' )
 
 CALL MNH_MEM_GET( ZF_1_Y,  SIZE( PPHI, 1 ), SIZE( PPHI, 2 ), SIZE( PPHI, 3 ) )
 CALL MNH_MEM_GET( ZCORREC, SIZE( PPHI, 1 ), SIZE( PPHI, 2 ), SIZE( PPHI, 3 ) )
@@ -276,7 +276,7 @@ END DO
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'RICHARDSON' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/slow_terms.f90 b/src/MNH/slow_terms.f90
index 80db2c4cf..2d7e5b7f9 100644
--- a/src/MNH/slow_terms.f90
+++ b/src/MNH/slow_terms.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2020 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -267,7 +267,7 @@ allocate( zdzz (JIU,JJU,JKU) )
 allocate( g3d  (JIU,JJU,JKU) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'SLOW_TERMS' )
 CALL MNH_MEM_GET( zt   ,JIU,JJU,JKU )
 CALL MNH_MEM_GET( zw   ,JIU,JJU,JKU )
 CALL MNH_MEM_GET( zw1  ,JIU,JJU,JKU )
@@ -591,7 +591,7 @@ END IF
 deallocate (zt, zw, zw1, zw2, zw3, zexnt, zdzz, g3d )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'SLOW_TERMS' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/sources_neg_correct.f90 b/src/MNH/sources_neg_correct.f90
index f08c426fa..b98dcb2e8 100644
--- a/src/MNH/sources_neg_correct.f90
+++ b/src/MNH/sources_neg_correct.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 2020-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2020-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -90,7 +90,7 @@ if ( .not. Associated( zcor ) ) Allocate( zcor(0, 0, 0) )
 ALLOCATE(ZTEMP_BUD( jiu, jju, jku ))
 #else
 !Pin positions in the pools of MNH memory
-call Mnh_mem_position_pin()
+call Mnh_mem_position_pin( 'Sources_neg_correct' )
 
 call Mnh_mem_get( zt,   jiu, jju, jku )
 call Mnh_mem_get( zexn, jiu, jju, jku )
@@ -469,7 +469,7 @@ end select CLOUD
 deallocate( zexn, zlv, zcph, zls, zcor , ZTEMP_BUD)
 #else
 !Release all memory allocated with Mnh_mem_get calls since last call to Mnh_mem_position_pin
-call Mnh_mem_release()
+call Mnh_mem_release( 'Sources_neg_correct' )
 #endif
 
 if ( hbudname /= 'NECON' .and. hbudname /= 'NEGA' ) then
diff --git a/src/MNH/tke_eps_sources.f90 b/src/MNH/tke_eps_sources.f90
index 0636775b9..1fb7b5dc4 100644
--- a/src/MNH/tke_eps_sources.f90
+++ b/src/MNH/tke_eps_sources.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -315,7 +315,7 @@ allocate( zsource(JIU,JJU,JKU ) )
 allocate( zkeff  (JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TKE_EPS_SOURCES' )
 
 CALL MNH_MEM_GET( za     ,JIU,JJU,JKU)
 CALL MNH_MEM_GET( zres   ,JIU,JJU,JKU)
@@ -685,7 +685,7 @@ end if
 deallocate( ZA, ZRES, ZFLX, ZSOURCE, ZKEFF )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TKE_EPS_SOURCES' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/tridiag_thermo.f90 b/src/MNH/tridiag_thermo.f90
index 871581a06..81b1efeb2 100644
--- a/src/MNH/tridiag_thermo.f90
+++ b/src/MNH/tridiag_thermo.f90
@@ -228,7 +228,7 @@ allocate( zgam                (JIU,JJU,JKU ) )
 allocate( zbet                (JIU,JJU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TRIDIAG_THERMO' )
 
 CALL MNH_MEM_GET( zrhodj_dfddtdz_o_dz2, JIU, JJU, JKU )
 CALL MNH_MEM_GET( zmzm_rhodj          , JIU, JJU, JKU )
@@ -481,7 +481,7 @@ end if
 deallocate (zrhodj_dfddtdz_o_dz2,zmzm_rhodj,za,zb,zc,zy,zgam,zbet)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TRIDIAG_THERMO' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/tridiag_tke.f90 b/src/MNH/tridiag_tke.f90
index 89840fb59..6187983ab 100644
--- a/src/MNH/tridiag_tke.f90
+++ b/src/MNH/tridiag_tke.f90
@@ -198,7 +198,7 @@ allocate( zgam(JIU,JJU,JKU ) )
 allocate( zbet(JIU,JJU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TRIDIAG_TKE' )
 
 CALL MNH_MEM_GET( zy  , JIU, JJU, JKU )
 CALL MNH_MEM_GET( zgam, JIU, JJU, JKU )
@@ -374,7 +374,7 @@ end if
 deallocate( ZY, ZGAM, ZBET )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TRIDIAG_TKE' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/tridiag_w.f90 b/src/MNH/tridiag_w.f90
index 62561c15f..8f5fb2e91 100644
--- a/src/MNH/tridiag_w.f90
+++ b/src/MNH/tridiag_w.f90
@@ -224,7 +224,7 @@ allocate( zgam                (JIU,JJU,JKU ) )
 allocate( zbet                (JIU,JJU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TRIDIAG_W' )
 
 CALL MNH_MEM_GET( zrhodj_dfddwdz_o_dz2,JIU,JJU,JKU )
 CALL MNH_MEM_GET( zmzm_rhodj          ,JIU,JJU,JKU )
@@ -447,7 +447,7 @@ end if
 deallocate (ZRHODJ_DFDDWDZ_O_DZ2, ZMZM_RHODJ, ZA, ZB, ZC, ZY, ZGAM, ZBET)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TRIDIAG_W' )
 #endif
 
 
diff --git a/src/MNH/tridiag_wind.f90 b/src/MNH/tridiag_wind.f90
index 58dd63f4d..8d7f982c0 100644
--- a/src/MNH/tridiag_wind.f90
+++ b/src/MNH/tridiag_wind.f90
@@ -205,7 +205,7 @@ allocate( zgam(JIU,JJU,JKU ) )
 allocate( zbet(JIU,JJU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TRIDIAG_WIND' )
 
 CALL MNH_MEM_GET( zy  , JIU, JJU, JKU )
 CALL MNH_MEM_GET( zgam, JIU, JJU, JKU )
@@ -345,7 +345,7 @@ end if
 deallocate ( zy,zgam,zbet )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TRIDIAG_WIND' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb.f90 b/src/MNH/turb.f90
index cbc2f4966..d1e733a48 100644
--- a/src/MNH/turb.f90
+++ b/src/MNH/turb.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -607,7 +607,7 @@ allocate( zdvdz (JIU,JJU, JKU_TURB ) )
 ALLOCATE(ZTEMP_BUD(JIU,JJU,JKU))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB 1' )
 
 CALL MNH_MEM_GET( ZCP,        JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZEXN,       JIU, JJU, JKU )
@@ -793,11 +793,11 @@ IF (KRRL >=1) THEN
     ALLOCATE(ZAMOIST_ICE(JIU,JJU,JKU))
     ALLOCATE(ZATHETA_ICE(JIU,JJU,JKU))
 #else
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'TURB 2' )
     CALL MNH_MEM_GET( ZLVOCPEXNM, JIU, JJU, JKU )
     CALL MNH_MEM_GET( ZLSOCPEXNM, JIU, JJU, JKU )
 
-    CALL MNH_MEM_POSITION_PIN()
+    CALL MNH_MEM_POSITION_PIN( 'TURB 3')
     CALL MNH_MEM_GET( ZAMOIST_ICE, JIU, JJU, JKU )
     CALL MNH_MEM_GET( ZATHETA_ICE, JIU, JJU, JKU )
 #endif
@@ -831,7 +831,7 @@ IF (KRRL >=1) THEN
     DEALLOCATE(ZAMOIST_ICE)
     DEALLOCATE(ZATHETA_ICE)
 #else
-    CALL MNH_MEM_RELEASE()
+    CALL MNH_MEM_RELEASE( 'TURB 3')
 #endif
   ELSE
     CALL COMPUTE_FUNCTION_THERMO(XALPW,XBETAW,XGAMW,XLVTT,XCL,ZT,ZEXN,ZCP, &
@@ -1501,7 +1501,7 @@ IF ( KRRL >= 1 ) THEN
     DEALLOCATE(ZLVOCPEXNM)
     DEALLOCATE(ZLSOCPEXNM)
 #else
-    CALL MNH_MEM_RELEASE()
+    CALL MNH_MEM_RELEASE( 'TURB 2' )
 #endif
   ELSE
 !$acc kernels present_cr(PRT,PRRS,PTHLT,PRTHLS, zlocpexnm )
@@ -1681,7 +1681,7 @@ deallocate( zcp, zexn, zt, zlocpexnm, zleps, ztrh,         &
             ZTEMP_BUD)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB 1' )
 #endif
 
 !$acc end data
@@ -1855,7 +1855,7 @@ end if
   allocate( zdrvsatdt( size( pexn, 1 ), size( pexn, 2 ), size( pexn, 3 ) ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'COMPUTE_FUNCTION_THERMO' )
 
 CALL MNH_MEM_GET( zrvsat   , size( pexn, 1 ), size( pexn, 2 ), size( pexn, 3 ) )
 CALL MNH_MEM_GET( zdrvsatdt, size( pexn, 1 ), size( pexn, 2 ), size( pexn, 3 ) )
@@ -1950,7 +1950,7 @@ CALL MNH_MEM_GET( zdrvsatdt, size( pexn, 1 ), size( pexn, 2 ), size( pexn, 3 ) )
   deallocate( zrvsat, zdrvsatdt )
 #else
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'COMPUTE_FUNCTION_THERMO' )
 #endif
 
 !$acc end data
@@ -2229,7 +2229,7 @@ end if
 
 #ifdef MNH_OPENACC
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'DELT')
 CALL MNH_MEM_GET( ztmp1_device, JIU,JJU,JKU )
 CALL MNH_MEM_GET( ztmp2_device, JIU,JJU,JKU )
 #endif
@@ -2374,7 +2374,7 @@ end if
 
 #ifdef MNH_OPENACC
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'DELT' )
 #endif
 
 END SUBROUTINE DELT
@@ -2506,7 +2506,7 @@ allocate( ZETHETA(JIU,JJU,JKU) )
 allocate( ZEMOIST(JIU,JJU,JKU) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'DEAR' )
 
 CALL MNH_MEM_GET( ZWORK2D, JIU, JJU )
 CALL MNH_MEM_GET( ZDTHLDZ, JIU, JJU, JKU )
@@ -2723,7 +2723,7 @@ end if
 deallocate(zwork2d, zdthldz, zdrtdz, zetheta, zemoist ) 
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'DEAR' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_dyn_corr.f90 b/src/MNH/turb_hor_dyn_corr.f90
index d66d1f983..7ab54da8e 100644
--- a/src/MNH/turb_hor_dyn_corr.f90
+++ b/src/MNH/turb_hor_dyn_corr.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -355,7 +355,7 @@ allocate( zcoeff(JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 allocate( zdzz  (JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_DYN_CORR' )
 
 CALL MNH_MEM_GET( zflx,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zwork, JIU, JJU, JKU )
@@ -1333,7 +1333,7 @@ DEALLOCATE (ZFLX, ZWORK, ZDIRSINZW, ZCOEFF, ZDZZ,                  &
             ZDU_DZ_DZS_DX, ZDV_DZ_DZS_DY, ZDU_DX, ZDV_DY, ZDW_DZ   )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_DYN_CORR' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_splt.f90 b/src/MNH/turb_hor_splt.f90
index b30e280c6..2f920f93e 100644
--- a/src/MNH/turb_hor_splt.f90
+++ b/src/MNH/turb_hor_splt.f90
@@ -459,7 +459,7 @@ ALLOCATE(ZINV_PDZZ(JIU,JJU,JKU))
 ALLOCATE(ZMZM_PRHODJ(JIU,JJU,JKU))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_SPLT 1' )
 
 CALL MNH_MEM_GET( ZK,          JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZINV_PDXX,   JIU, JJU, JKU )
@@ -515,7 +515,7 @@ IF (KSPLIT>1 .AND. CPROGRAM=='MESONH') THEN
   ALLOCATE(ZRRS(SIZE(PRRS,1),SIZE(PRRS,2),SIZE(PRRS,3),SIZE(PRRS,4)))
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_SPLT 2' )
 
   CALL MNH_MEM_GET( ZUM, JIU, JJU, JKU )
   CALL MNH_MEM_GET( ZVM, JIU, JJU, JKU )
@@ -758,7 +758,7 @@ IF (KSPLIT>1 .AND. CPROGRAM=='MESONH') THEN
   DEALLOCATE(ZRTHLS)
   DEALLOCATE(ZRRS)
 #else
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'TURB_HOR_SPLT 2' )
 #endif
   
   !
@@ -809,7 +809,7 @@ DEALLOCATE(ZINV_PDZZ)
 DEALLOCATE(ZMZM_PRHODJ)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since beginning of subroutine
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_SPLT 1' )
 #endif
 
 if ( mppdb_initialized ) then
diff --git a/src/MNH/turb_hor_sv_flux.f90 b/src/MNH/turb_hor_sv_flux.f90
index 9cf51e163..fbdbf0f23 100644
--- a/src/MNH/turb_hor_sv_flux.f90
+++ b/src/MNH/turb_hor_sv_flux.f90
@@ -245,7 +245,7 @@ allocate( zwork2d(JIU,JJU, 1 ) )
 allocate( zcoeff(JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_SV_FLUX' )
 
 CALL MNH_MEM_GET( zflxx, JIU, JJU, JKU )
 CALL MNH_MEM_GET( zflxy, JIU, JJU, JKU )
@@ -640,7 +640,7 @@ end if
 deallocate( ZFLXX, ZFLXY, ZWORK2D, ZCOEFF )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_SV_FLUX' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_thermo_corr.f90 b/src/MNH/turb_hor_thermo_corr.f90
index 260054485..4098559c4 100644
--- a/src/MNH/turb_hor_thermo_corr.f90
+++ b/src/MNH/turb_hor_thermo_corr.f90
@@ -265,7 +265,7 @@ allocate( za   (JIU,JJU,JKU ) )
 allocate( zcoeff(JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_THERMO_CORR' )
 
 CALL MNH_MEM_GET( zflx ,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zwork , JIU, JJU, JKU )
@@ -905,7 +905,7 @@ end if
 deallocate (zflx,zwork,za,zcoeff)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_THERMO_CORR' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_thermo_flux.f90 b/src/MNH/turb_hor_thermo_flux.f90
index e1fc823fd..d36659eef 100644
--- a/src/MNH/turb_hor_thermo_flux.f90
+++ b/src/MNH/turb_hor_thermo_flux.f90
@@ -279,7 +279,7 @@ allocate( zflxc(JIU,JJU,JKU) )
 allocate( zcoeff(JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_THERMO_FLUX' )
 
 CALL MNH_MEM_GET( zflx,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zflxc, JIU, JJU, JKU )
@@ -1794,7 +1794,7 @@ end if
 deallocate (zflx,zflxc,zcoeff)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_THERMO_FLUX' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_tke.f90 b/src/MNH/turb_hor_tke.f90
index d538b366d..bc2f326e2 100644
--- a/src/MNH/turb_hor_tke.f90
+++ b/src/MNH/turb_hor_tke.f90
@@ -178,7 +178,7 @@ allocate( zflx (JIU,JJU,JKU ) )
 allocate( zcoeff(JIU,JJU, 1 + jpvext : 3 + jpvext ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_TKE' )
 
 CALL MNH_MEM_GET( zflx, JIU, JJU, JKU )
 
@@ -536,7 +536,7 @@ end if
 deallocate( ZCOEFF, ZFLX )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_TKE' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_uv.f90 b/src/MNH/turb_hor_uv.f90
index b9d578a59..c2478f1c0 100644
--- a/src/MNH/turb_hor_uv.f90
+++ b/src/MNH/turb_hor_uv.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -285,7 +285,7 @@ allocate( gy_u_uv_pum(JIU,JJU,JKU ) )
 allocate( gx_v_uv_pvm(JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_UV' )
 
 CALL MNH_MEM_GET( zflx,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zwork, JIU, JJU, JKU )
@@ -831,7 +831,7 @@ end if
 deallocate ( ZFLX, ZWORK, ZDIRSINZW, GY_U_UV_PUM, GX_V_UV_PVM )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_UV' )
 #endif
      
 
diff --git a/src/MNH/turb_hor_uw.f90 b/src/MNH/turb_hor_uw.f90
index 186fb9de8..8179cacc1 100644
--- a/src/MNH/turb_hor_uw.f90
+++ b/src/MNH/turb_hor_uw.f90
@@ -242,7 +242,7 @@ allocate( zwork(JIU,JJU,JKU ) )
 allocate( gx_w_uw_pwm(JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_UW' )
 
 CALL MNH_MEM_GET( zflx,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zwork, JIU, JJU, JKU )
@@ -600,7 +600,7 @@ end if
 deallocate( ZFLX, ZWORK, GX_W_UW_PWM )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_UW' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_hor_vw.f90 b/src/MNH/turb_hor_vw.f90
index 023773412..7792771dc 100644
--- a/src/MNH/turb_hor_vw.f90
+++ b/src/MNH/turb_hor_vw.f90
@@ -239,7 +239,7 @@ allocate( zwork(JIU,JJU,JKU ) )
 allocate( gy_w_vw_pwm(JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_HOR_VW' )
 
 CALL MNH_MEM_GET( zflx,  JIU, JJU, JKU )
 CALL MNH_MEM_GET( zwork, JIU, JJU, JKU )
@@ -629,7 +629,7 @@ end if
 deallocate( ZFLX, ZWORK, GY_W_VW_PWM )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_HOR_VW' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_ver.f90 b/src/MNH/turb_ver.f90
index 21851b90b..8cd2a2ff7 100644
--- a/src/MNH/turb_ver.f90
+++ b/src/MNH/turb_ver.f90
@@ -576,7 +576,7 @@ allocate( zthlp    (JIU,JJU,JKU) )
 allocate( zrp      (JIU,JJU,JKU) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_VER' )
 
 CALL MNH_MEM_GET( zbeta,     JIU, JJU, JKU )
 CALL MNH_MEM_GET( zsqrt_tke, JIU, JJU, JKU )
@@ -917,7 +917,7 @@ DEALLOCATE(zbeta,zsqrt_tke,zdth_dz,zdr_dz,zred2th3,zred2r3,zred2thr3, &
 DEALLOCATE(zpsi_sv,zreds1,zred2ths,zred2rs)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_VER' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_ver_dyn_flux.f90 b/src/MNH/turb_ver_dyn_flux.f90
index f608c5be7..18fb68491 100644
--- a/src/MNH/turb_ver_dyn_flux.f90
+++ b/src/MNH/turb_ver_dyn_flux.f90
@@ -482,7 +482,7 @@ allocate( zuslopem (JIU,JJU, 1 ) )
 allocate( zvslopem (JIU,JJU, 1 ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_VER_DYN_FLUX' )
 
 CALL MNH_MEM_GET( zdirsinzw, JIU, JJU )
 
@@ -1647,7 +1647,7 @@ end if
 deallocate (zdirsinzw,zcoefs,za,zres,zflxz,zsource,zkeff,zcoefflxu,zcoefflxv,zuslopem,zvslopem)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_VER_DYN_FLUX' )
 #endif
 !$acc end data
 
diff --git a/src/MNH/turb_ver_thermo_corr.f90 b/src/MNH/turb_ver_thermo_corr.f90
index c4a205956..383ce40f4 100644
--- a/src/MNH/turb_ver_thermo_corr.f90
+++ b/src/MNH/turb_ver_thermo_corr.f90
@@ -483,7 +483,7 @@ allocate( zdfddrdz  (JIU,JJU,JKU) )
 allocate( zcoeff(JIU,JJU, i1 : i2 ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_VER_THERMO_CORR' )
 
 CALL MNH_MEM_GET( zflxz,    JIU, JJU, JKU )
 CALL MNH_MEM_GET( zkeff,    JIU, JJU, JKU )
@@ -1560,7 +1560,7 @@ end if
 deallocate( zflxz, zkeff, zf , zdfddtdz , zdfddrdz , zcoeff )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_VER_THERMO_CORR' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/turb_ver_thermo_flux.f90 b/src/MNH/turb_ver_thermo_flux.f90
index bf4f25c3e..a9499222d 100644
--- a/src/MNH/turb_ver_thermo_flux.f90
+++ b/src/MNH/turb_ver_thermo_flux.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 1994-2022 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 1994-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
@@ -614,7 +614,7 @@ allocate( zcld_thold(JIU,JJU,JKU ) )
 allocate( zalt      (JIU,JJU,JKU ) )
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'TURB_VER_THERMO_FLUX' )
 
 CALL MNH_MEM_GET( za,         JIU,JJU,JKU )
 CALL MNH_MEM_GET( zflxz,      JIU,JJU,JKU )
@@ -1828,7 +1828,7 @@ end if
 Deallocate( za, zflxz, zsource, zkeff, zf, zdfddtdz, zdfddrdz, z3rdmoment, zf_new, zrwthl, zrwrnp, zcld_thold, zalt )
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'TURB_VER_THERMO_FLUX' )
 #endif
 
 !$acc end data
diff --git a/src/MNH/zdiffusetup.f90 b/src/MNH/zdiffusetup.f90
index 955853512..41e271e21 100644
--- a/src/MNH/zdiffusetup.f90
+++ b/src/MNH/zdiffusetup.f90
@@ -1,4 +1,4 @@
-!MNH_LIC Copyright 2006-2020 CNRS, Meteo-France and Universite Paul Sabatier
+!MNH_LIC Copyright 2006-2023 CNRS, Meteo-France and Universite Paul Sabatier
 !MNH_LIC This is part of the Meso-NH software governed by the CeCILL-C licence
 !MNH_LIC version 1. See LICENSE, CeCILL-C_V1-en.txt and CeCILL-C_V1-fr.txt
 !MNH_LIC for details. version 1.
diff --git a/src/MNH/zsolver.f90 b/src/MNH/zsolver.f90
index 36f2e3f91..c8b9fe7ab 100644
--- a/src/MNH/zsolver.f90
+++ b/src/MNH/zsolver.f90
@@ -193,7 +193,7 @@ JKU =  size(PPHI, 3 )
 ALLOCATE(ZDELTA(JIU,JJU,JKU),ZKSI(JIU,JJU,JKU),ZP(JIU,JJU,JKU),ZQ(JIU,JJU,JKU),ZRESIDUE(JIU,JJU,JKU))
 #else
 !Pin positions in the pools of MNH memory
-CALL MNH_MEM_POSITION_PIN()
+CALL MNH_MEM_POSITION_PIN( 'ZSOLVER' )
 
 CALL MNH_MEM_GET( ZDELTA   , JIU, JJU, JKU )
 CALL MNH_MEM_GET( ZKSI     , JIU, JJU, JKU )
@@ -277,7 +277,7 @@ END DO              ! end of the loop for the iterative solver
 DEALLOCATE(ZDELTA,ZKSI,ZP,ZQ,ZRESIDUE)
 #else
 !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-CALL MNH_MEM_RELEASE()
+CALL MNH_MEM_RELEASE( 'ZSOLVER' )
 #endif
 !-------------------------------------------------------------------------------
 !
diff --git a/src/MNH/zsolver_inv.f90 b/src/MNH/zsolver_inv.f90
index a488737d0..281c8e14b 100644
--- a/src/MNH/zsolver_inv.f90
+++ b/src/MNH/zsolver_inv.f90
@@ -182,7 +182,7 @@ END MODULE MODI_ZSOLVER_INV
   ALLOCATE(ZY(IIU,IJU,IKU))
 #else
   !Pin positions in the pools of MNH memory
-  CALL MNH_MEM_POSITION_PIN()
+  CALL MNH_MEM_POSITION_PIN( 'ZSOLVER_INV' )
 
   CALL MNH_MEM_GET( ZY, IIU, IJU, IKU )
 #endif
@@ -292,7 +292,7 @@ END MODULE MODI_ZSOLVER_INV
   DEALLOCATE(ZY)
 #else
   !Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
-  CALL MNH_MEM_RELEASE()
+  CALL MNH_MEM_RELEASE( 'ZSOLVER_INV' )
 #endif  
   !
 CONTAINS
-- 
GitLab