Index: NEMO/trunk/src/OCE/do_loop_substitute.h90
===================================================================
--- NEMO/trunk/src/OCE/do_loop_substitute.h90	(revision 12377)
+++ NEMO/trunk/src/OCE/do_loop_substitute.h90	(revision 13286)
@@ -50,54 +50,247 @@
 ! includes the possibility of strides for which an extra set of DO_3DS macros are defined.
 !
-! In the following definitions the inner PE domain is defined by start indices of (___kIs_, __kJs_) and end indices of (__kIe_, __kJe_)
-! The following macros are defined just below: ___kIs_, __kJs_, ___kIsm1_, __kJsm1_, ___kIe_, __kJe_, ___kIep1_, __kJep1_. 
+! In the following definitions the inner PE domain is defined by start indices of (_Nis0, Njs0) and end indices of (Nie0, Njs0)
+! The following macros are defined just below: _Nis0, Njs0, _Nis1, Njs1, _Nie0, Njs0, _Nie1, Nje1. 
 ! These names are chosen to, hopefully, avoid any future, unintended matches elsewhere in the code.
 !
+!!gm changes ;
+!
+! -0- fortran code : defined in par_oce.F90 the folowwing valiables :
+!!# 
+!!#    INTEGER, PUBLIC ::   Nis0, Nis1, Nis2   !: start I-index (_0: no halo, _1 & _2: 1 & 2-halos)
+!!#    INTEGER, PUBLIC ::   Nie0, Nie1, Nie2   !: end   I-index (_0: no halo, _1 & _2: 1 & 2-halos)
+!!#    INTEGER, PUBLIC ::   Njs0, Njs1, Njs2   !: start J-index (_0: no halo, _1 & _2: 1 & 2-halos)
+!!#    INTEGER, PUBLIC ::   Nje0, Nje1, Nje2   !: end   J-index (_0: no halo, _1 & _2: 1 & 2-halos)
+!!# 
+! -1- fortran code  put in  mppinit.F90 :   
+!!#            just after the futur read of nn_hls in namXXX (to be defined)
+!!#            NB: currently nn_hls is defined as a parameter in par_oce.F90
+!!#   SUBROUTINE init_do_loop
+!!#      !!----------------------------------------------------------------------
+!!#      !!                  ***  ROUTINE init_do_loop_indices  ***
+!!#      !!
+!!#      !! ** Purpose :   set the starting/ending indices of DO-loop
+!!#      !!              These indices are used in do_loop_substitute.h90
+!!#      !!----------------------------------------------------------------------!!# !                             !==  set the starting/ending indices of DO-loop  ==!   (used in do_loop_substitute.h90)
+!!#      !
+!!#      IF(     nn_hls == 1 ) THEN          !* halo size of 1
+!!#         !
+!!#         Nis0 =   2     ;   Nis1 =   1     ;   Nis2 = Nis1
+!!#         Njs0 = Nis0    ;   Njs1 = Nis1    ;   Njs2 = Nis1
+!!#         !
+!!#         Nie0 = jpi-1   ;   Nje1 = jpi     ;   Nie2 = Nie1
+!!#         Nje0 = jpj-1   ;   Nje1 = jpj-1   ;   Nje2 = Nie1
+!!#         !
+!!#      ELSEIF( nn_hls == 2 ) THEN          !* halo size of 2
+!!#         !
+!!#         Nis0 =   3     ;   Nis1 =   2     ;   Nis2 =   1
+!!#         Njs0 = Nis0    ;   Njs1 = Nis1    ;   Njs2 = Nis2
+!!#         !
+!!#         Nie0 = jpi-2   ;   Nje1 = jpi-1   ;   Nie2 = jpi
+!!#         Nje0 = jpj-2   ;   Nje1 = jpj-1   ;   Nje2 = jpj
+!!#         !
+!!#      ELSE                                !* unexpected halo size
+!!#         CALL ctl_stop( 'STOP', 'ini_mpp:  wrong value of halo size : nn_hls= 1 or 2 only !')
+!!#      ENDIF
+!!#
+!!#      !
+!!#   END SUBROUTINE init_do_loop
+!
+!  ! -2- in do_loop_substitute becomes :
+! 
 #endif
-#define __kIs_     2
-#define __kJs_     2
-#define __kIsm1_   1
-#define __kJsm1_   1
-
-#define __kIe_     jpim1
-#define __kJe_     jpjm1
-#define __kIep1_   jpi
-#define __kJep1_   jpj
-
-#define DO_2D_00_00   DO jj = __kJs_, __kJe_   ;   DO ji = __kIs_, __kIe_
-#define DO_2D_00_01   DO jj = __kJs_, __kJe_   ;   DO ji = __kIs_, __kIep1_
-#define DO_2D_00_10   DO jj = __kJs_, __kJe_   ;   DO ji = __kIsm1_, __kIe_
-#define DO_2D_00_11   DO jj = __kJs_, __kJe_   ;   DO ji = __kIsm1_, __kIep1_
- 
-#define DO_2D_01_00   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIs_, __kIe_
-#define DO_2D_01_01   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIs_, __kIep1_
-#define DO_2D_01_10   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIsm1_, __kIe_
-#define DO_2D_01_11   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIsm1_, __kIep1_
- 
-#define DO_2D_10_00   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIs_, __kIe_
-#define DO_2D_10_10   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIe_
-#define DO_2D_10_11   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIep1_
- 
-#define DO_2D_11_00   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIs_, __kIe_
-#define DO_2D_11_01   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIs_, __kIep1_
-#define DO_2D_11_10   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIsm1_, __kIe_
-#define DO_2D_11_11   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIsm1_, __kIep1_
-
-#define DO_3D_00_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_00
-#define DO_3D_00_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_10
- 
-#define DO_3D_01_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_01
- 
-#define DO_3D_10_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_00
-#define DO_3D_10_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_10
-#define DO_3D_10_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_11
- 
-#define DO_3D_11_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_11
-
-#define DO_3DS_00_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_00
-#define DO_3DS_01_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_01
-#define DO_3DS_10_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_10
-#define DO_3DS_11_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_11
-
+
+! 2D loops with 1
+
+#define DO_2D_00_00   DO jj = Njs0, Nje0   ;   DO ji = Nis0, Nie0
+#define DO_2D_00_01   DO jj = Njs0, Nje0   ;   DO ji = Nis0, Nie1
+#define DO_2D_00_10   DO jj = Njs0, Nje0   ;   DO ji = Nis1, Nie0
+#define DO_2D_00_11   DO jj = Njs0, Nje0   ;   DO ji = Nis1, Nie1
+ 
+#define DO_2D_01_00   DO jj = Njs0, Nje1   ;   DO ji = Nis0, Nie0
+#define DO_2D_01_01   DO jj = Njs0, Nje1   ;   DO ji = Nis0, Nie1
+#define DO_2D_01_10   DO jj = Njs0, Nje1   ;   DO ji = Nis1, Nie0
+#define DO_2D_01_11   DO jj = Njs0, Nje1   ;   DO ji = Nis1, Nie1
+ 
+#define DO_2D_10_00   DO jj = Njs1, Nje0   ;   DO ji = Nis0, Nie0
+#define DO_2D_10_01   DO jj = Njs1, Nje0   ;   DO ji = Nis0, Nie1   ! not used ?
+#define DO_2D_10_10   DO jj = Njs1, Nje0   ;   DO ji = Nis1, Nie0
+#define DO_2D_10_11   DO jj = Njs1, Nje0   ;   DO ji = Nis1, Nie1
+ 
+#define DO_2D_11_00   DO jj = Njs1, Nje1   ;   DO ji = Nis0, Nie0
+#define DO_2D_11_01   DO jj = Njs1, Nje1   ;   DO ji = Nis0, Nie1
+#define DO_2D_11_10   DO jj = Njs1, Nje1   ;   DO ji = Nis1, Nie0
+#define DO_2D_11_11   DO jj = Njs1, Nje1   ;   DO ji = Nis1, Nie1
+
+! 2D loops with 1 following a 2/3D loop with 2
+
+#define DO_2D_00_01nxt2   DO jj = Njs0    , Nje0       ;   DO ji = Nis0    , Nie1nxt2
+#define DO_2D_00_10nxt2   DO jj = Njs0    , Nje0       ;   DO ji = Nis1nxt2, Nie0
+#define DO_2D_00_11nxt2   DO jj = Njs0    , Nje0       ;   DO ji = Nis1nxt2, Nie1nxt2
+
+#define DO_2D_01_00nxt2   DO jj = Njs0    , Nje1nxt2   ;   DO ji = Nis0    , Nie0
+#define DO_2D_01_01nxt2   DO jj = Njs0    , Nje1nxt2   ;   DO ji = Nis0    , Nie1nxt2
+#define DO_2D_01_10nxt2   DO jj = Njs0    , Nje1nxt2   ;   DO ji = Nis1nxt2, Nie0
+#define DO_2D_01_11nxt2   DO jj = Njs0    , Nje1nxt2   ;   DO ji = Nis1nxt2, Nie1nxt2
+
+#define DO_2D_10_00nxt2   DO jj = Njs1nxt2, Nje0       ;   DO ji = Nis0    , Nie0
+#define DO_2D_10_01nxt2   DO jj = Njs1nxt2, Nje0       ;   DO ji = Nis0    , Nie1nxt2   ! not used ?
+#define DO_2D_10_10nxt2   DO jj = Njs1nxt2, Nje0       ;   DO ji = Nis1nxt2, Nie0
+#define DO_2D_10_11nxt2   DO jj = Njs1nxt2, Nje0       ;   DO ji = Nis1nxt2, Nie1nxt2
+
+#define DO_2D_11_00nxt2   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis0    , Nie0
+#define DO_2D_11_01nxt2   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis0    , Nie1nxt2
+#define DO_2D_11_10nxt2   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis1nxt2, Nie0
+#define DO_2D_11_11nxt2   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis1nxt2, Nie1nxt2
+
+! 2D loops with 2
+
+#define DO_2D_11_12   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis1nxt2, Nie2
+#define DO_2D_11_21   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis2    , Nie1nxt2
+#define DO_2D_11_22   DO jj = Njs1nxt2, Nje1nxt2   ;   DO ji = Nis2    , Nie2
+
+#define DO_2D_12_11   DO jj = Njs1nxt2, Nje2       ;   DO ji = Nis1nxt2, Nie1nxt2
+#define DO_2D_12_12   DO jj = Njs1nxt2, Nje2       ;   DO ji = Nis1nxt2, Nie2
+#define DO_2D_12_21   DO jj = Njs1nxt2, Nje2       ;   DO ji = Nis2    , Nie1nxt2
+#define DO_2D_12_22   DO jj = Njs1nxt2, Nje2       ;   DO ji = Nis2    , Nie2
+ 
+#define DO_2D_21_11   DO jj = Njs2    , Nje1nxt2   ;   DO ji = Nis1nxt2, Nie1nxt2
+#define DO_2D_21_12   DO jj = Njs2    , Nje1nxt2   ;   DO ji = Nis1nxt2, Nie2        ! not used ?
+#define DO_2D_21_21   DO jj = Njs2    , Nje1nxt2   ;   DO ji = Nis2    , Nie1nxt2
+#define DO_2D_21_22   DO jj = Njs2    , Nje1nxt2   ;   DO ji = Nis2    , Nie2
+                                     
+#define DO_2D_22_11   DO jj = Njs2    , Nje2       ;   DO ji = Nis1nxt2, Nie1nxt2
+#define DO_2D_22_12   DO jj = Njs2    , Nje2       ;   DO ji = Nis1nxt2, Nie2
+#define DO_2D_22_21   DO jj = Njs2    , Nje2       ;   DO ji = Nis2    , Nie1nxt2
+#define DO_2D_22_22   DO jj = Njs2    , Nje2       ;   DO ji = Nis2    , Nie2
+
+! 3D loops with 1
+
+#define DO_3D_00_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_00   
+#define DO_3D_00_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_01   
+#define DO_3D_00_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_10   
+#define DO_3D_00_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_11   
+
+#define DO_3D_01_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_00   
+#define DO_3D_01_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_01   
+#define DO_3D_01_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_10   
+#define DO_3D_01_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_11   
+
+#define DO_3D_10_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_00   
+#define DO_3D_10_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_01   
+#define DO_3D_10_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_10   
+#define DO_3D_10_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_11   
+
+#define DO_3D_11_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_00   
+#define DO_3D_11_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_01   
+#define DO_3D_11_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_10   
+#define DO_3D_11_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_11   
+
+! 3D loops with 1, following a 2/3D loop with 2
+
+#define DO_3D_00_01nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_01nxt2   
+#define DO_3D_00_10nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_10nxt2   
+#define DO_3D_00_11nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_11nxt2   
+
+#define DO_3D_01_00nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_00nxt2   
+#define DO_3D_01_01nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_01nxt2   
+#define DO_3D_01_10nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_10nxt2   
+#define DO_3D_01_11nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_11nxt2   
+
+#define DO_3D_10_00nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_00nxt2   
+#define DO_3D_10_01nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_01nxt2   
+#define DO_3D_10_10nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_10nxt2   
+#define DO_3D_10_11nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_11nxt2   
+
+#define DO_3D_11_00nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_00nxt2   
+#define DO_3D_11_01nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_01nxt2   
+#define DO_3D_11_10nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_10nxt2   
+#define DO_3D_11_11nxt2(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_11nxt2   
+
+! 3D loops with 2
+
+#define DO_3D_11_12(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_12   
+#define DO_3D_11_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_21   
+#define DO_3D_11_22(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_22   
+
+#define DO_3D_12_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_12_11   
+#define DO_3D_12_12(ks,ke)   DO jk = ks, ke   ;   DO_2D_12_12   
+#define DO_3D_12_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_12_21   
+#define DO_3D_12_22(ks,ke)   DO jk = ks, ke   ;   DO_2D_12_22   
+
+#define DO_3D_21_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_11   
+#define DO_3D_21_12(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_12   
+#define DO_3D_21_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_21   
+#define DO_3D_21_22(ks,ke)   DO jk = ks, ke   ;   DO_2D_21_22   
+
+#define DO_3D_22_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_22_11   
+#define DO_3D_22_12(ks,ke)   DO jk = ks, ke   ;   DO_2D_22_12   
+#define DO_3D_22_21(ks,ke)   DO jk = ks, ke   ;   DO_2D_22_21   
+#define DO_3D_22_22(ks,ke)   DO jk = ks, ke   ;   DO_2D_22_22   
+                                
+! 3D loops with increment with 1
+
+#define DO_3DS_00_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_00   
+#define DO_3DS_00_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_01   
+#define DO_3DS_00_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_10   
+#define DO_3DS_00_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_11   
+
+#define DO_3DS_01_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_00   
+#define DO_3DS_01_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_01   
+#define DO_3DS_01_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_10   
+#define DO_3DS_01_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_11   
+
+#define DO_3DS_10_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_00   
+#define DO_3DS_10_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_01   
+#define DO_3DS_10_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_10   
+#define DO_3DS_10_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_11   
+
+#define DO_3DS_11_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_00   
+#define DO_3DS_11_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_01   
+#define DO_3DS_11_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_10   
+#define DO_3DS_11_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_11   
+                                
+! 3D loops with increment with 1, following a 2/3D loop with 2
+
+#define DO_3DS_00_01nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_01nxt2   
+#define DO_3DS_00_10nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_10nxt2   
+#define DO_3DS_00_11nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_11nxt2   
+
+#define DO_3DS_01_00nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_00nxt2   
+#define DO_3DS_01_01nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_01nxt2   
+#define DO_3DS_01_10nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_10nxt2   
+#define DO_3DS_01_11nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_11nxt2   
+
+#define DO_3DS_10_00nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_00nxt2   
+#define DO_3DS_10_01nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_01nxt2   
+#define DO_3DS_10_10nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_10nxt2   
+#define DO_3DS_10_11nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_11nxt2   
+
+#define DO_3DS_11_00nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_00nxt2   
+#define DO_3DS_11_01nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_01nxt2   
+#define DO_3DS_11_10nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_10nxt2   
+#define DO_3DS_11_11nxt2(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_11nxt2   
+
+! 3D loops with increment with 2
+
+#define DO_3DS_11_12(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_12   
+#define DO_3DS_11_21(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_21   
+#define DO_3DS_11_22(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_22   
+
+#define DO_3DS_12_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_12_11   
+#define DO_3DS_12_12(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_12_12   
+#define DO_3DS_12_21(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_12_21   
+#define DO_3DS_12_22(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_12_22   
+
+#define DO_3DS_21_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_21_11   
+#define DO_3DS_21_12(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_21_12   
+#define DO_3DS_21_21(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_21_21   
+#define DO_3DS_21_22(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_21_22   
+
+#define DO_3DS_22_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_22_11   
+#define DO_3DS_22_12(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_22_12   
+#define DO_3DS_22_21(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_22_21   
+#define DO_3DS_22_22(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_22_22   
+                                
 #define END_2D   END DO   ;   END DO
 #define END_3D   END DO   ;   END DO   ;   END DO
