Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpim-sw
libcdi
Commits
118ba858
Commit
118ba858
authored
May 05, 2011
by
Deike Kleberg
Browse files
Little changes in names in resources files.
parent
41a76147
Changes
8
Hide whitespace changes
Inline
Side-by-side
pioExamples/myModel.c
View file @
118ba858
...
...
@@ -123,10 +123,8 @@ void modelRun ()
varID1
=
vlistDefVar
(
vlistID
,
gridID
,
zaxisID1
,
TIME_VARIABLE
);
varID2
=
vlistDefVar
(
vlistID
,
gridID
,
zaxisID2
,
TIME_VARIABLE
);
//
instID = institutDef(
98, 232,"MPIMET", "Max-Planck-Institute for Meteorology
");
instID
=
institutDef
(
0
,
0
,
"MYINSTITUTE"
,
"myInstitute
"
);
modelID
=
modelDef
(
instID
,
0
,
"myModel"
);
localtableID
=
tableDef
(
modelID
,
128
,
"myModelLocalTable"
);
nudgingtableID
=
tableDef
(
modelID
,
129
,
"myModelNudgingTable"
);
// Define the variable names
vlistDefVarName
(
vlistID
,
varID1
,
"varname1"
);
...
...
src/grid.c
View file @
118ba858
...
...
@@ -53,10 +53,9 @@ static int GRID_Debug = 0; /* If set to 1, debugging */
static
void
grid
_init_ptr
(
grid_t
*
gridptr
)
void
grid
DefaultValue
(
grid_t
*
gridptr
)
{
gridptr
->
self
=
-
1
;
gridptr
->
self
=
CDI_UNDEFID
;
gridptr
->
type
=
CDI_UNDEFID
;
gridptr
->
mask
=
NULL
;
gridptr
->
mask_gme
=
NULL
;
...
...
@@ -119,26 +118,35 @@ void grid_init_ptr(grid_t *gridptr)
gridptr
->
ystdname
[
0
]
=
0
;
}
static
void
grid_init_entry
(
grid_t
*
gridptr
)
grid_t
*
gridNewEntry
(
void
)
{
grid_
init_ptr
(
gridptr
)
;
grid_
t
*
gridptr
;
gridptr
=
(
grid_t
*
)
xmalloc
(
sizeof
(
grid_t
));
gridDefaultValue
(
gridptr
);
gridptr
->
self
=
reshPut
((
void
*
)
gridptr
,
&
gridOps
);
return
gridptr
;
}
static
grid_t
*
grid_new_entry
(
void
)
void
gridInit
(
void
)
{
grid_t
*
gridptr
;
static
int
gridInitialized
=
0
;
char
*
env
;
gridptr
=
(
grid_t
*
)
malloc
(
sizeof
(
grid_t
))
;
if
(
gridInitialized
)
return
;
if
(
gridptr
)
grid_init_entry
(
gridptr
);
gridInitialized
=
1
;
return
(
gridptr
);
env
=
getenv
(
"GRID_DEBUG"
);
if
(
env
)
GRID_Debug
=
atoi
(
env
);
}
static
void
grid_copy
(
grid_t
*
gridptr2
,
grid_t
*
gridptr1
)
{
...
...
@@ -353,7 +361,9 @@ int gridCreate(int gridtype, int size)
if
(
CDI_Debug
)
Message
(
"gridtype: %d size: %d"
,
gridtype
,
size
);
gridptr
=
grid_new_entry
();
gridInit
();
gridptr
=
gridNewEntry
();
if
(
!
gridptr
)
Error
(
"No memory"
);
gridID
=
gridptr
->
self
;
...
...
src/institution.c
View file @
118ba858
...
...
@@ -27,8 +27,6 @@ typedef struct
institute_t
;
static
int
instituteInitialized
=
0
;
int
instituteCompareP
(
void
*
instituteptr1
,
void
*
instituteptr2
);
void
instituteDestroyP
(
void
*
instituteptr
);
void
institutePrintP
(
void
*
instituteptr
);
...
...
@@ -69,11 +67,13 @@ institute_t * instituteNewEntry ( void )
static
void
instituteInit
(
void
)
{
static
int
instituteInitialized
=
0
;
if
(
instituteInitialized
)
return
;
instituteInitialized
=
1
;
instituteDefault
();
}
...
...
@@ -191,7 +191,7 @@ int institutDef(int center, int subcenter, const char *name, const char *longnam
if
(
name
)
instituteptr
->
name
=
strdupx
(
name
);
if
(
longname
)
instituteptr
->
longname
=
strdupx
(
longname
);
return
(
instituteptr
->
self
)
;
return
instituteptr
->
self
;
}
...
...
@@ -261,7 +261,7 @@ int institutInqNumber(void)
instNum
++
;
}
free
(
instIndice
);
if
(
instIndice
)
free
(
instIndice
);
return
instNum
;
}
...
...
@@ -294,7 +294,7 @@ void instituteDestroyP ( void * instituteptr )
id
=
i1
->
self
;
free
(
instituteptr
);
if
(
instituteptr
)
free
(
instituteptr
);
reshRemove
(
id
,
&
instituteOps
);
}
...
...
src/model.c
View file @
118ba858
...
...
@@ -28,12 +28,7 @@ model_t;
static
int
MODEL_Debug
=
0
;
/* If set to 1, debugging */
static
void
model_initialize
(
void
);
static
int
model_init
=
FALSE
;
# define MODEL_INIT \
if ( model_init == FALSE ) model_initialize();
static
void
modelInit
(
void
);
int
modelCompareP
(
void
*
modelptr1
,
void
*
modelptr2
);
...
...
@@ -101,15 +96,18 @@ void model_defaults(void)
}
static
void
model
_i
nit
ialize
(
void
)
void
model
I
nit
(
void
)
{
static
int
modelInitialized
=
0
;
char
*
env
;
if
(
modelInitialized
)
return
;
modelInitialized
=
1
;
env
=
getenv
(
"MODEL_DEBUG"
);
if
(
env
)
MODEL_Debug
=
atoi
(
env
);
model_init
=
TRUE
;
model_defaults
();
}
...
...
@@ -135,7 +133,7 @@ int modelInq(int instID, int modelgribID, char *name)
model_t
*
modelptr
;
int
i
,
*
modelIndice
;
MODEL_INIT
modelInit
();
modelCount
=
modelSize
();
modelIndice
=
xmalloc
(
modelCount
*
sizeof
(
int
));
...
...
@@ -185,7 +183,7 @@ int modelDef(int instID, int modelgribID, const char *name)
{
model_t
*
modelptr
;
MODEL_INIT
modelInit
();
modelptr
=
modelNewEntry
();
...
...
@@ -201,7 +199,7 @@ int modelInqInstitut(int modelID)
{
model_t
*
modelptr
;
MODEL_INIT
modelInit
();
modelptr
=
(
model_t
*
)
reshGetVal
(
modelID
,
&
modelOps
);
...
...
@@ -213,7 +211,7 @@ int modelInqGribID(int modelID)
{
model_t
*
modelptr
;
MODEL_INIT
modelInit
();
modelptr
=
(
model_t
*
)
reshGetVal
(
modelID
,
&
modelOps
);
...
...
@@ -225,7 +223,7 @@ char *modelInqNamePtr(int modelID)
{
model_t
*
modelptr
;
MODEL_INIT
modelInit
();
modelptr
=
(
model_t
*
)
reshGetVal
(
modelID
,
&
modelOps
);
...
...
src/resource_handle.c
View file @
118ba858
...
...
@@ -191,8 +191,8 @@ void *reshGetVal ( cdiResH idx, resOps * ops )
ARRAY_UNLOCK
();
assert
(
node
->
ops
==
ops
);
assert
(
node
);
assert
(
node
->
ops
==
ops
);
return
node
->
ptr
;
}
...
...
src/stream_int.c
View file @
118ba858
...
...
@@ -232,12 +232,11 @@ stream_t *stream_to_pointer(int idx)
static
void
stream
_init_ptr
(
stream_t
*
streamptr
)
void
stream
DefaultValue
(
stream_t
*
streamptr
)
{
int
i
;
streamptr
->
self
=
-
1
;
streamptr
->
self
=
UNDEFID
;
streamptr
->
accesstype
=
UNDEFID
;
streamptr
->
accessmode
=
0
;
streamptr
->
filetype
=
UNDEFID
;
...
...
@@ -292,26 +291,19 @@ void stream_init_ptr ( stream_t * streamptr )
}
static
void
stream_init_entry
(
stream_t
*
streamptr
)
{
stream_init_ptr
(
streamptr
);
streamptr
->
self
=
reshPut
((
void
*
)
streamptr
,
&
streamOps
);
}
stream_t
*
stream_new_entry
(
void
)
{
stream_t
*
streamptr
;
cdiInitialize
();
/* ***************** make MT version !!! */
streamptr
=
(
stream_t
*
)
malloc
(
sizeof
(
stream_t
));
streamptr
=
(
stream_t
*
)
x
malloc
(
sizeof
(
stream_t
));
if
(
streamptr
)
stream_init_entry
(
streamptr
);
streamDefaultValue
(
streamptr
);
streamptr
->
self
=
reshPut
((
void
*
)
streamptr
,
&
streamOps
);
return
(
streamptr
)
;
return
streamptr
;
}
...
...
src/taxis.c
View file @
118ba858
...
...
@@ -88,10 +88,9 @@ void taxis_defaults(void)
static
void
taxis
_init_ptr
(
taxis_t
*
taxisptr
)
void
taxis
DefaultValue
(
taxis_t
*
taxisptr
)
{
taxisptr
->
self
=
-
1
;
taxisptr
->
self
=
CDI_UNDEFID
;
taxisptr
->
used
=
FALSE
;
taxisptr
->
type
=
DefaultTimeType
;
taxisptr
->
vdate
=
0
;
...
...
@@ -108,24 +107,33 @@ void taxis_init_ptr(taxis_t *taxisptr)
taxisptr
->
vtime_ub
=
0
;
}
static
void
taxis_init_entry
(
taxis_t
*
taxis
ptr
)
taxis_t
*
taxis
NewEntry
(
void
)
{
taxis_
init_ptr
(
taxisptr
)
;
taxis_
t
*
taxisptr
;
taxisptr
=
(
taxis_t
*
)
xmalloc
(
sizeof
(
taxis_t
));
taxisDefaultValue
(
taxisptr
);
taxisptr
->
self
=
reshPut
((
void
*
)
taxisptr
,
&
taxisOps
);
return
(
taxisptr
);
}
static
taxis_t
*
taxis_new_entry
(
void
)
void
taxisInit
(
void
)
{
taxis_t
*
taxisptr
;
static
int
taxisInitialized
=
0
;
char
*
env
;
taxisptr
=
(
taxis_t
*
)
malloc
(
sizeof
(
taxis_t
))
;
if
(
taxisInitialized
)
return
;
if
(
taxisptr
)
taxis_init_entry
(
taxisptr
);
taxisInitialized
=
1
;
return
(
taxisptr
);
env
=
getenv
(
"TAXIS_DEBUG"
);
if
(
env
)
TAXIS_Debug
=
atoi
(
env
);
}
...
...
@@ -186,8 +194,9 @@ int taxisCreate(int taxistype)
if
(
CDI_Debug
)
Message
(
"taxistype: %d"
,
taxistype
);
taxisptr
=
taxis_new_entry
();
if
(
!
taxisptr
)
Error
(
"No memory"
);
taxisInit
();
taxisptr
=
taxisNewEntry
();
taxisID
=
taxisptr
->
self
;
taxisptr
->
type
=
taxistype
;
...
...
@@ -247,7 +256,7 @@ int taxisDuplicate(int taxisID1)
taxisptr1
=
(
taxis_t
*
)
reshGetVal
(
taxisID1
,
&
taxisOps
);
taxisptr2
=
taxis
_new_e
ntry
();
taxisptr2
=
taxis
NewE
ntry
();
if
(
!
taxisptr2
)
Error
(
"No memory"
);
taxisID2
=
taxisptr2
->
self
;
...
...
@@ -1151,7 +1160,7 @@ double cdiEncodeTimeval(int date, int time, taxis_t *taxis)
void
ptaxisInit
(
taxis_t
*
taxisptr
)
{
taxis
_init_ptr
(
taxisptr
);
taxis
DefaultValue
(
taxisptr
);
}
...
...
src/zaxis.c
View file @
118ba858
...
...
@@ -71,10 +71,9 @@ static int ZAXIS_Debug = 0; /* If set to 1, debugging */
static
void
zaxis
_init_ptr
(
zaxis_t
*
zaxisptr
)
void
zaxis
DefaultValue
(
zaxis_t
*
zaxisptr
)
{
zaxisptr
->
self
=
-
1
;
zaxisptr
->
self
=
CDI_UNDEFID
;
zaxisptr
->
name
[
0
]
=
0
;
zaxisptr
->
longname
[
0
]
=
0
;
zaxisptr
->
units
[
0
]
=
0
;
...
...
@@ -91,24 +90,34 @@ void zaxis_init_ptr ( zaxis_t *zaxisptr )
zaxisptr
->
vct
=
NULL
;
}
static
void
zaxis_init_entry
(
zaxis_t
*
zaxis
ptr
)
zaxis_t
*
zaxis
NewEntry
(
void
)
{
zaxis_init_ptr
(
zaxisptr
);
zaxis_t
*
zaxisptr
;
zaxisptr
=
(
zaxis_t
*
)
xmalloc
(
sizeof
(
zaxis_t
));
zaxisDefaultValue
(
zaxisptr
);
zaxisptr
->
self
=
reshPut
((
void
*
)
zaxisptr
,
&
zaxisOps
);
return
(
zaxisptr
);
}
static
zaxis_t
*
zaxis_new_entry
(
void
)
void
zaxisInit
(
void
)
{
zaxis_t
*
zaxisptr
;
static
int
zaxisInitialized
=
0
;
char
*
env
;
zaxisptr
=
(
zaxis_t
*
)
malloc
(
sizeof
(
zaxis_t
))
;
if
(
zaxisInitialized
)
return
;
if
(
zaxisptr
)
zaxis_init_entry
(
zaxisptr
);
zaxisInitialized
=
1
;
return
(
zaxisptr
);
env
=
getenv
(
"ZAXIS_DEBUG"
);
if
(
env
)
ZAXIS_Debug
=
atoi
(
env
);
}
...
...
@@ -182,8 +191,9 @@ int zaxisCreate(int zaxistype, int size)
if
(
CDI_Debug
)
Message
(
"zaxistype: %d size: %d "
,
zaxistype
,
size
);
zaxisptr
=
zaxis_new_entry
();
if
(
!
zaxisptr
)
Error
(
"No memory"
);
zaxisInit
();
zaxisptr
=
zaxisNewEntry
();
zaxisID
=
zaxisptr
->
self
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment