Commit 86fa9937 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

moved declaration of vlistInqVarNamePtr, vlistInqVarLongnamePtr, vlistInqVarUnitsPtr to cdi.h

parent ef08ba93
...@@ -664,6 +664,10 @@ double vlistInqVarDblKey(int vlistID, int varID, const char *name); ...@@ -664,6 +664,10 @@ double vlistInqVarDblKey(int vlistID, int varID, const char *name);
/* vlistInqVarIntKey: raw access to GRIB meta-data */ /* vlistInqVarIntKey: raw access to GRIB meta-data */
int vlistInqVarIntKey(int vlistID, int varID, const char *name); int vlistInqVarIntKey(int vlistID, int varID, const char *name);
/* needed only for CDO operator after */
const char *vlistInqVarNamePtr(int vlistID, int varID);
const char *vlistInqVarLongnamePtr(int vlistID, int varID);
const char *vlistInqVarUnitsPtr(int vlistID, int varID);
/* VLIST attributes */ /* VLIST attributes */
...@@ -1140,6 +1144,7 @@ int tableInqParName(int tableID, int code, char *name); ...@@ -1140,6 +1144,7 @@ int tableInqParName(int tableID, int code, char *name);
int tableInqParLongname(int tableID, int code, char *longname); int tableInqParLongname(int tableID, int code, char *longname);
int tableInqParUnits(int tableID, int code, char *units); int tableInqParUnits(int tableID, int code, char *units);
/* needed only for CDO operator after */
const char *tableInqParNamePtr(int tableID, int parID); const char *tableInqParNamePtr(int tableID, int parID);
const char *tableInqParLongnamePtr(int tableID, int parID); const char *tableInqParLongnamePtr(int tableID, int parID);
const char *tableInqParUnitsPtr(int tableID, int parID); const char *tableInqParUnitsPtr(int tableID, int parID);
......
...@@ -407,6 +407,9 @@ module mo_cdi ...@@ -407,6 +407,9 @@ module mo_cdi
public :: vlistHasVarKey public :: vlistHasVarKey
public :: vlistInqVarDblKey public :: vlistInqVarDblKey
public :: vlistInqVarIntKey public :: vlistInqVarIntKey
public :: vlistInqVarNamePtr
public :: vlistInqVarLongnamePtr
public :: vlistInqVarUnitsPtr
public :: vlistInqNatts public :: vlistInqNatts
public :: vlistInqAtt public :: vlistInqAtt
public :: vlistDelAtt public :: vlistDelAtt
...@@ -4449,6 +4452,75 @@ contains ...@@ -4449,6 +4452,75 @@ contains
f_result = lib_vlistInqVarIntKey(vlistID_dummy, varID_dummy, name_temp) f_result = lib_vlistInqVarIntKey(vlistID_dummy, varID_dummy, name_temp)
end function vlistInqVarIntKey end function vlistInqVarIntKey
function vlistInqVarNamePtr(vlistID_dummy, varID_dummy) result(f_result)
character(kind = c_char), dimension(:), pointer :: f_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
type(c_ptr) :: ptr
integer :: rv_shape(1)
interface
function lib_vlistInqVarNamePtr(vlistID_dummy, varID_dummy) bind(c, name&
& = 'vlistInqVarNamePtr') result(c_result)
import c_int, c_ptr
type(c_ptr) :: c_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
end function lib_vlistInqVarNamePtr
end interface
f_result => null()
ptr = lib_vlistInqVarNamePtr(vlistID_dummy, varID_dummy)
if(c_associated(ptr)) then
rv_shape(1) = int(lib_strlen(ptr))
call c_f_pointer(ptr, f_result, rv_shape)
end if
end function vlistInqVarNamePtr
function vlistInqVarLongnamePtr(vlistID_dummy, varID_dummy) result(f_result)
character(kind = c_char), dimension(:), pointer :: f_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
type(c_ptr) :: ptr
integer :: rv_shape(1)
interface
function lib_vlistInqVarLongnamePtr(vlistID_dummy, varID_dummy) bind(c,&
& name = 'vlistInqVarLongnamePtr') result(c_result)
import c_int, c_ptr
type(c_ptr) :: c_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
end function lib_vlistInqVarLongnamePtr
end interface
f_result => null()
ptr = lib_vlistInqVarLongnamePtr(vlistID_dummy, varID_dummy)
if(c_associated(ptr)) then
rv_shape(1) = int(lib_strlen(ptr))
call c_f_pointer(ptr, f_result, rv_shape)
end if
end function vlistInqVarLongnamePtr
function vlistInqVarUnitsPtr(vlistID_dummy, varID_dummy) result(f_result)
character(kind = c_char), dimension(:), pointer :: f_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
type(c_ptr) :: ptr
integer :: rv_shape(1)
interface
function lib_vlistInqVarUnitsPtr(vlistID_dummy, varID_dummy) bind(c, name&
& = 'vlistInqVarUnitsPtr') result(c_result)
import c_int, c_ptr
type(c_ptr) :: c_result
integer(c_int), value :: vlistID_dummy
integer(c_int), value :: varID_dummy
end function lib_vlistInqVarUnitsPtr
end interface
f_result => null()
ptr = lib_vlistInqVarUnitsPtr(vlistID_dummy, varID_dummy)
if(c_associated(ptr)) then
rv_shape(1) = int(lib_strlen(ptr))
call c_f_pointer(ptr, f_result, rv_shape)
end if
end function vlistInqVarUnitsPtr
function vlistInqAtt(vlistID_dummy, varID_dummy, attrnum_dummy, name_dummy,& function vlistInqAtt(vlistID_dummy, varID_dummy, attrnum_dummy, name_dummy,&
& typep_dummy, lenp_dummy) result(f_result) & typep_dummy, lenp_dummy) result(f_result)
integer(c_int) :: f_result integer(c_int) :: f_result
......
...@@ -142,10 +142,7 @@ vlist_t *vlist_to_pointer(int vlistID); ...@@ -142,10 +142,7 @@ vlist_t *vlist_to_pointer(int vlistID);
void cdiVlistMakeInternal(int vlistID); void cdiVlistMakeInternal(int vlistID);
void cdiVlistMakeImmutable(int vlistID); void cdiVlistMakeImmutable(int vlistID);
void vlistCheckVarID(const char *caller, int vlistID, int varID); void vlistCheckVarID(const char *caller, int vlistID, int varID);
const char *vlistInqVarNamePtr(int vlistID, int varID);
const char *vlistInqVarLongnamePtr(int vlistID, int varID);
const char *vlistInqVarStdnamePtr(int vlistID, int varID); const char *vlistInqVarStdnamePtr(int vlistID, int varID);
const char *vlistInqVarUnitsPtr(int vlistID, int varID);
void vlistDestroyVarName(int vlistID, int varID); void vlistDestroyVarName(int vlistID, int varID);
void vlistDestroyVarLongname(int vlistID, int varID); void vlistDestroyVarLongname(int vlistID, int varID);
void vlistDestroyVarStdname(int vlistID, int varID); void vlistDestroyVarStdname(int vlistID, int varID);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment