MOM6
MOM_memory_macros.h File Reference

Detailed Description

Memory macros.

This is a header file to define macros for static and dynamic memory allocation. Define STATIC_MEMORY_ in MOM_memory.h for static memory allocation. Otherwise dynamic memory allocation will be assumed. For explanation of symmetric and non-symmetric memory modes see Horizontal indexing and memory.

Definition in file MOM_memory_macros.h.

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DEALLOC_(x)   deallocate(x)
 Deallocates array x when using dynamic memory mode. Does nothing in static memory mode. More...
 
#define ALLOC_(x)   allocate(x)
 Allocates array x when using dynamic memory mode. Does nothing in static memory mode. More...
 
#define ALLOCABLE_   ,allocatable
 Attaches the ALLOCATABLE attribute to an array in dynamic memory mode. Does nothing in static memory mode. More...
 
#define PTR_   ,pointer
 Attaches the POINTER attribute to an array in dynamic memory mode. Does nothing in static memory mode. More...
 
#define TO_NULL_   =>NULL()
 Nullify a pointer in dynamic memory mode. Does nothing in static memory mode. More...
 
#define NIMEM_   :
 Expands to : in dynamic memory mode, or is the i-shape of a tile in static memory mode. More...
 
#define NJMEM_   :
 Expands to : in dynamic memory mode, or is the j-shape of a tile in static memory mode. More...
 
#define NIMEMB_PTR_   :
 Expands to : in dynamic memory mode, or to NIMEMB_ in static memory mode. More...
 
#define NJMEMB_PTR_   :
 Expands to : in dynamic memory mode, or to NJMEMB_ in static memory mode. More...
 
#define NIMEMB_   :
 Expands to : or 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode. More...
 
#define NJMEMB_   :
 Expands to : or 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode. More...
 
#define NIMEMB_SYM_   0:
 Expands to 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode. More...
 
#define NJMEMB_SYM_   0:
 Expands to 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode. More...
 
#define NKMEM_   :
 Expands to : in dynamic memory mode or is to the number of layers in static memory mode. More...
 
#define NKMEM0_   0:
 Expands to 0: in dynamic memory mode or to 0:NK_ in static memory mode. More...
 
#define NK_INTERFACE_   :
 Expands to : in dynamic memory mode or to NK_+1 in static memory mode. More...
 
#define C1_   :
 Expands to : or 1. UNKNOWN PURPOSE! More...
 
#define C2_   :
 Expands to : or 2. UNKNOWN PURPOSE! More...
 
#define C3_   :
 Expands to : or 3. UNKNOWN PURPOSE! More...
 
#define SZI_(G)   G%isd:G%ied
 The i-shape of a dummy argument staggered at h- or v-points. More...
 
#define SZJ_(G)   G%jsd:G%jed
 The j-shape of a dummy argument staggered at h- or u-points. More...
 
#define SZK_(G)   G%ke
 The k-shape of a layer dummy argument. More...
 
#define SZK0_(G)   0:G%ke
 The k-shape of an interface dummy argument. More...
 
#define SZIB_(G)   G%IsdB:G%IedB
 The i-shape of a dummy argument staggered at q- or u-points. More...
 
#define SZJB_(G)   G%JsdB:G%JedB
 The j-shape of a dummy argument staggered at q- or v-points. More...
 
#define SZIBS_(G)   G%isd-1:G%ied
 The i-shape of a symmetric dummy argument staggered at q- or u-points. More...
 
#define SZJBS_(G)   G%jsd-1:G%jed
 The j-shape of a symmetric dummy argument staggered at q- or v-points. More...
 
#define SZDI_(G)   G%isd:G%ied
 The i-shape of a dynamic dummy argument staggered at h- or v-points. More...
 
#define SZDIB_(G)   G%IsdB:G%IedB
 The i-shape of a dynamic dummy argument staggered at q- or u-points. More...
 
#define SZDJ_(G)   G%jsd:G%jed
 The j-shape of a dynamic dummy argument staggered at h- or u-points. More...
 
#define SZDJB_(G)   G%JsdB:G%JedB
 The j-shape of a dynamic dummy argument staggered at q- or v-points. More...
 

Macro Definition Documentation

◆ ALLOC_

#define ALLOC_ (   x)    allocate(x)

Allocates array x when using dynamic memory mode. Does nothing in static memory mode.

Definition at line 100 of file MOM_memory_macros.h.

◆ ALLOCABLE_

#define ALLOCABLE_   ,allocatable

Attaches the ALLOCATABLE attribute to an array in dynamic memory mode. Does nothing in static memory mode.

Definition at line 102 of file MOM_memory_macros.h.

◆ C1_

#define C1_   :

Expands to : or 1. UNKNOWN PURPOSE!

Definition at line 153 of file MOM_memory_macros.h.

◆ C2_

#define C2_   :

Expands to : or 2. UNKNOWN PURPOSE!

Definition at line 155 of file MOM_memory_macros.h.

◆ C3_

#define C3_   :

Expands to : or 3. UNKNOWN PURPOSE!

Definition at line 157 of file MOM_memory_macros.h.

◆ DEALLOC_

#define DEALLOC_ (   x)    deallocate(x)

Deallocates array x when using dynamic memory mode. Does nothing in static memory mode.

Definition at line 98 of file MOM_memory_macros.h.

◆ NIMEM_

#define NIMEM_   :

Expands to : in dynamic memory mode, or is the i-shape of a tile in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at h- or v- points.

Definition at line 112 of file MOM_memory_macros.h.

◆ NIMEMB_

#define NIMEMB_   :

Expands to : or 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at q- or u- points.

Definition at line 132 of file MOM_memory_macros.h.

◆ NIMEMB_PTR_

#define NIMEMB_PTR_   :

Expands to : in dynamic memory mode, or to NIMEMB_ in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at h- or v- points.

Definition at line 118 of file MOM_memory_macros.h.

◆ NIMEMB_SYM_

#define NIMEMB_SYM_   0:

Expands to 0: in dynamic memory mode, or is the staggered i-shape of a tile in static memory mode.

Use for always-symmetric heap (ALLOCABLE_ or PTR_) variables at q- or u- points.

Definition at line 139 of file MOM_memory_macros.h.

◆ NJMEM_

#define NJMEM_   :

Expands to : in dynamic memory mode, or is the j-shape of a tile in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at h- or u- points.

Definition at line 115 of file MOM_memory_macros.h.

◆ NJMEMB_

#define NJMEMB_   :

Expands to : or 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at q- or v- points.

Definition at line 135 of file MOM_memory_macros.h.

◆ NJMEMB_PTR_

#define NJMEMB_PTR_   :

Expands to : in dynamic memory mode, or to NJMEMB_ in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) variables at h- or u- points.

Definition at line 121 of file MOM_memory_macros.h.

◆ NJMEMB_SYM_

#define NJMEMB_SYM_   0:

Expands to 0: in dynamic memory mode, or is the staggered j-shape of a tile in static memory mode.

Use for always-symmetric heap (ALLOCABLE_ or PTR_) variables at q- or v- points.

Definition at line 142 of file MOM_memory_macros.h.

◆ NK_INTERFACE_

#define NK_INTERFACE_   :

Expands to : in dynamic memory mode or to NK_+1 in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) interface variables.

Definition at line 151 of file MOM_memory_macros.h.

◆ NKMEM0_

#define NKMEM0_   0:

Expands to 0: in dynamic memory mode or to 0:NK_ in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) interface variables.

Definition at line 148 of file MOM_memory_macros.h.

◆ NKMEM_

#define NKMEM_   :

Expands to : in dynamic memory mode or is to the number of layers in static memory mode.

Use for heap (ALLOCABLE_ or PTR_) layer variables.

Definition at line 145 of file MOM_memory_macros.h.

◆ PTR_

#define PTR_   ,pointer

Attaches the POINTER attribute to an array in dynamic memory mode. Does nothing in static memory mode.

Definition at line 104 of file MOM_memory_macros.h.

◆ SZDI_

#define SZDI_ (   G)    G%isd:G%ied

The i-shape of a dynamic dummy argument staggered at h- or v-points.

Definition at line 185 of file MOM_memory_macros.h.

◆ SZDIB_

#define SZDIB_ (   G)    G%IsdB:G%IedB

The i-shape of a dynamic dummy argument staggered at q- or u-points.

Definition at line 187 of file MOM_memory_macros.h.

◆ SZDJ_

#define SZDJ_ (   G)    G%jsd:G%jed

The j-shape of a dynamic dummy argument staggered at h- or u-points.

Definition at line 189 of file MOM_memory_macros.h.

◆ SZDJB_

#define SZDJB_ (   G)    G%JsdB:G%JedB

The j-shape of a dynamic dummy argument staggered at q- or v-points.

Definition at line 191 of file MOM_memory_macros.h.

◆ SZI_

#define SZI_ (   G)    G%isd:G%ied

The i-shape of a dummy argument staggered at h- or v-points.

Todo:
Explain or remove C1_, C2_ and C3_

Definition at line 164 of file MOM_memory_macros.h.

◆ SZIB_

#define SZIB_ (   G)    G%IsdB:G%IedB

The i-shape of a dummy argument staggered at q- or u-points.

Definition at line 172 of file MOM_memory_macros.h.

◆ SZIBS_

#define SZIBS_ (   G)    G%isd-1:G%ied

The i-shape of a symmetric dummy argument staggered at q- or u-points.

Definition at line 176 of file MOM_memory_macros.h.

◆ SZJ_

#define SZJ_ (   G)    G%jsd:G%jed

The j-shape of a dummy argument staggered at h- or u-points.

Definition at line 166 of file MOM_memory_macros.h.

◆ SZJB_

#define SZJB_ (   G)    G%JsdB:G%JedB

The j-shape of a dummy argument staggered at q- or v-points.

Definition at line 174 of file MOM_memory_macros.h.

◆ SZJBS_

#define SZJBS_ (   G)    G%jsd-1:G%jed

The j-shape of a symmetric dummy argument staggered at q- or v-points.

Definition at line 178 of file MOM_memory_macros.h.

◆ SZK0_

#define SZK0_ (   G)    0:G%ke

The k-shape of an interface dummy argument.

Definition at line 170 of file MOM_memory_macros.h.

◆ SZK_

#define SZK_ (   G)    G%ke

The k-shape of a layer dummy argument.

Definition at line 168 of file MOM_memory_macros.h.

◆ TO_NULL_

#define TO_NULL_   =>NULL()

Nullify a pointer in dynamic memory mode. Does nothing in static memory mode.

Definition at line 106 of file MOM_memory_macros.h.