aboutsummaryrefslogtreecommitdiff
path: root/src/SetupGroup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/SetupGroup.c')
-rw-r--r--src/SetupGroup.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/SetupGroup.c b/src/SetupGroup.c
index 8fdca77..7a93391 100644
--- a/src/SetupGroup.c
+++ b/src/SetupGroup.c
@@ -174,7 +174,7 @@ static int PUGH_SetupGAGroup (pGH *newGH,
/* Set up the communication buffer used for all variables within this group.
Note: only with allocated buffers we can have group communication. */
groupcomm = NULL;
- if(newGH->commmodel == PUGH_ALLOCATEDBUFFERS)
+ if(n_variables > 0 && newGH->commmodel == PUGH_ALLOCATEDBUFFERS)
{
groupcomm = PUGH_SetupGArrayGroupComm (newGH,
dim,
@@ -213,7 +213,7 @@ static int PUGH_SetupGAGroup (pGH *newGH,
staggercode,
vectorlength,
variable%vectorlength,
- variable%vectorlength > 0 ? newGH->variables[newGH->nvariables-variable%vectorlength][level] : NULL);
+ variable%vectorlength > 0 ? newGH->variables[newGH->nvariables - variable%vectorlength][level] : NULL);
newGH->narrays++;
}
newGH->nvariables++;