source: NEMO/branches/2020/dev_r12563_ASINTER-06_ABL_improvement/src/OCE/do_loop_substitute.h90 @ 14325

Last change on this file since 14325 was 12377, checked in by acc, 14 months ago

The big one. Merging all 2019 developments from the option 1 branch back onto the trunk.

This changeset reproduces 2019/dev_r11943_MERGE_2019 on the trunk using a 2-URL merge
onto a working copy of the trunk. I.e.:

svn merge —ignore-ancestry \

svn+ssh:// \
svn+ssh:// ./

The —ignore-ancestry flag avoids problems that may otherwise arise from the fact that
the merge history been trunk and branch may have been applied in a different order but
care has been taken before this step to ensure that all applicable fixes and updates
are present in the merge branch.

The trunk state just before this step has been branched to releases/release-4.0-HEAD
and that branch has been immediately tagged as releases/release-4.0.2. Any fixes
or additions in response to tickets on 4.0, 4.0.1 or 4.0.2 should be done on
releases/release-4.0-HEAD. From now on future 'point' releases (e.g. 4.0.2) will
remain unchanged with periodic releases as needs demand. Note release-4.0-HEAD is a
transitional naming convention. Future full releases, say 4.2, will have a release-4.2
branch which fulfills this role and the first point release (e.g. 4.2.0) will be made
immediately following the release branch creation.

2020 developments can be started from any trunk revision later than this one.

File size: 4.8 KB
1#if defined show_comments
2! These comments are not intended to be retained during preprocessing; i.e. do not define "show_comments"
4!! NEMO/OCE 4.0 , NEMO Consortium (2018)
5!! Software governed by the CeCILL license (see ./LICENSE)
7! This header file contains preprocessor definitions and macros used in the do-loop substitutions introduced
8! between version 4.0 and 4.2. The primary aim of these macros is to assist in future applications of tiling
9! to improve performance. This is expected to be achieved by alternative versions of these macros in selected
10! locations. The initial introduction of these macros simply replaces all identifiable nested 2D- and 3D-loops
11! with single line statements (and adjusts indenting accordingly). Do loops are identifiable if they comform
12! to either:
13!                                       DO jk = ....
14!   DO jj = ....                           DO jj = ...
15!      DO ji = ....                           DO ji = ...
16!         .                   OR                 . 
17!         .                                      .
18!     END DO                                  END DO
19!   END DO                                 END DO
20!                                       END DO
21! and white-space variants thereof.
23! Additionally, only loops with recognised jj and ji loops limits are treated; these are:
24! Lower limits of 1, 2 or fs_2
25! Upper limits of jpi, jpim1 or fs_jpim1 (for ji) or jpj, jpjm1 or fs_jpjm1 (for jj)
27! The macro naming convention takes the form: DO_2D_BT_LR where:
28!   B is the Bottom offset from the PE's inner domain;
29!   T is the Top    offset from the PE's inner domain;
30!   L is the Left   offset from the PE's inner domain;
31!   R is the Right  offset from the PE's inner domain
33! So, given an inner domain of 2,jpim1 and 2,jpjm1, a typical example would replace:
35!   DO jj = 2, jpj
36!      DO ji = 1, jpim1
37!         .
38!         .
39!      END DO
40!   END DO
42! with:
44!   DO_2D_01_10
45!      .
46!      .
47!   END_2D
49! similar conventions apply to the 3D loops macros. jk loop limits are retained through macro arguments and are not restricted. This
50! includes the possibility of strides for which an extra set of DO_3DS macros are defined.
52! In the following definitions the inner PE domain is defined by start indices of (___kIs_, __kJs_) and end indices of (__kIe_, __kJe_)
53! The following macros are defined just below: ___kIs_, __kJs_, ___kIsm1_, __kJsm1_, ___kIe_, __kJe_, ___kIep1_, __kJep1_.
54! These names are chosen to, hopefully, avoid any future, unintended matches elsewhere in the code.
57#define __kIs_     2
58#define __kJs_     2
59#define __kIsm1_   1
60#define __kJsm1_   1
62#define __kIe_     jpim1
63#define __kJe_     jpjm1
64#define __kIep1_   jpi
65#define __kJep1_   jpj
67#define DO_2D_00_00   DO jj = __kJs_, __kJe_   ;   DO ji = __kIs_, __kIe_
68#define DO_2D_00_01   DO jj = __kJs_, __kJe_   ;   DO ji = __kIs_, __kIep1_
69#define DO_2D_00_10   DO jj = __kJs_, __kJe_   ;   DO ji = __kIsm1_, __kIe_
70#define DO_2D_00_11   DO jj = __kJs_, __kJe_   ;   DO ji = __kIsm1_, __kIep1_
72#define DO_2D_01_00   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIs_, __kIe_
73#define DO_2D_01_01   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIs_, __kIep1_
74#define DO_2D_01_10   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIsm1_, __kIe_
75#define DO_2D_01_11   DO jj = __kJs_, __kJep1_   ;   DO ji = __kIsm1_, __kIep1_
77#define DO_2D_10_00   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIs_, __kIe_
78#define DO_2D_10_10   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIe_
79#define DO_2D_10_11   DO jj = __kJsm1_, __kJe_   ;   DO ji = __kIsm1_, __kIep1_
81#define DO_2D_11_00   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIs_, __kIe_
82#define DO_2D_11_01   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIs_, __kIep1_
83#define DO_2D_11_10   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIsm1_, __kIe_
84#define DO_2D_11_11   DO jj = __kJsm1_, __kJep1_   ;   DO ji = __kIsm1_, __kIep1_
86#define DO_3D_00_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_00
87#define DO_3D_00_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_00_10
89#define DO_3D_01_01(ks,ke)   DO jk = ks, ke   ;   DO_2D_01_01
91#define DO_3D_10_00(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_00
92#define DO_3D_10_10(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_10
93#define DO_3D_10_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_10_11
95#define DO_3D_11_11(ks,ke)   DO jk = ks, ke   ;   DO_2D_11_11
97#define DO_3DS_00_00(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_00_00
98#define DO_3DS_01_01(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_01_01
99#define DO_3DS_10_10(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_10_10
100#define DO_3DS_11_11(ks,ke,ki)   DO jk = ks, ke, ki   ;   DO_2D_11_11
102#define END_2D   END DO   ;   END DO
103#define END_3D   END DO   ;   END DO   ;   END DO
Note: See TracBrowser for help on using the repository browser.