summaryrefslogtreecommitdiff
path: root/src/main/Coord.c
diff options
context:
space:
mode:
authorallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-18 10:21:33 +0000
committerallen <allen@17b73243-c579-4c4c-a9d2-2d5706c11dac>2000-12-18 10:21:33 +0000
commit8b6b44b9e1f56070073ad852aa41b453f3f65896 (patch)
tree17e8ebc8fb9ee25380f4fb847ef9271db0c81943 /src/main/Coord.c
parent4bfaf89ca72fd897f14f7a53c22231ea5a554cb7 (diff)
Checking for non-valid case of coordinate direction = 0, and adding to
grdoc and docs Fixes Cactus/401 git-svn-id: http://svn.cactuscode.org/flesh/trunk@1974 17b73243-c579-4c4c-a9d2-2d5706c11dac
Diffstat (limited to 'src/main/Coord.c')
-rw-r--r--src/main/Coord.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/src/main/Coord.c b/src/main/Coord.c
index a59e6e73..81cd4c68 100644
--- a/src/main/Coord.c
+++ b/src/main/Coord.c
@@ -410,7 +410,52 @@ void CCTK_FCALL CCTK_FNAME(CCTK_CoordRegisterRange)
+ /*@@
+ @routine CoordIndex
+ @date
+ @author Gabrielle Allen
+ @desc
+ Return the index for a grid variable registered as a coordinate, taking
+ as input the coordinate system name and either the coordinate name or the
+ coordinate direction
+ @enddesc
+ @calls
+ @var dir
+ @vdesc the direction of the coordinate
+ @vtype int
+ @vio in
+ @vcomment
+ The range of the coordinate direction is (1,coord system dimension)
+ If the coord direction is > 0 it is used to calculate the coordinate grid
+ variable index, if it is <=0 then the coordinate name is used
+ @endvar
+ @var name
+ @vdesc the name of the coordinate (used only if dir <= 0)
+ @vtype const char *
+ @vio in
+ @vcomment
+ If the coord direction is > 0 it is used to calculate the coordinate grid
+ variable index, if it is <=0 then the coordinate name is used
+ @endvar
+ @var systemname
+ @vdesc the name of the coordinate system
+ @vtype const char *
+ @vio in
+ @vcomment
+
+ @endvar
+
+ @returntype int
+ @returndesc
+ >=0 = grid variable index for coordinate
+ -1 = no coordinate systems registered
+ -2 = coordinate system not registered
+ -3 = coordinate name not found
+ -4 = coordinate direction greater than system dimension
+ @endreturndesc
+
+ @@*/
int CCTK_CoordIndex(int dir, const char *name, const char *systemname)
{
@@ -427,7 +472,7 @@ int CCTK_CoordIndex(int dir, const char *name, const char *systemname)
0);
if (data)
{
- if (dir>-1)
+ if (dir>0)
{
if (dir>data->dimension)
{