gridspec_api/host/nccf_host.h

00001 
00007 #ifndef _NCCF_HOST_H
00008 #define _NCCF_HOST_H
00009 
00010 #include <netcdf.h>
00011 #include <libcf_src.h>
00012 #include <cflistitem.h>
00013 
00014 #include <nccf_varObj.h>
00015 #include <nccf_mosaic.h>
00016 #include <nccf_data.h>
00017 #include <nccf_grid.h>
00018 #include <nccf_coord.h>
00019 #include <nccf_constants.h>
00020 #include <nccf_handle_error.h>
00021 
00022 extern struct CFLISTITEM *CFLIST_HOST;
00023 
00024 struct var_information {
00025   
00026   /* Name of variable */
00027   char *varname;
00028 
00029   /* Grid, Static or Time category */
00030   char *grid_stat_time_cat;
00031 
00032   /* Variable resides in these files */
00033   /* Each item is a nccf_varObj for each file. */
00034   struct CFLISTITEM *file_var_obj;
00035 
00036   /* Number of dimensions */
00037   int ndims;
00038 
00039   /* Dimension Ids for variable */
00040   int *dimids;
00041 
00042   /* Number of attributes */
00043   int natts;
00044 
00045 };
00046 
00047 struct nccf_host_type {
00048 
00049   /* NetCDF like variable objects */
00050   struct nccf_var_obj *global;
00051 
00052   struct CFLISTITEM *gridFiles;
00053   struct CFLISTITEM *gridNames;
00054   struct CFLISTITEM *timeDataFiles;
00055   struct CFLISTITEM *statDataFiles;
00056 
00057   /* List of var_information structures */
00058   /* Each variables item will be of var_information */
00059   struct CFLISTITEM *variables;
00060   int nVars;
00061 
00062   /* Permanent data containers for the above nccf_var_obj objects */
00063   char *mosaicFileBuffer;
00064 
00065   /* if mosaic file was added */
00066   int hasMosaic;
00067 
00068   /* number of grids (or tiles) */
00069   int nGrids;
00070 
00071   /* number of static data files (e.g. topography),
00072      the host files will contain nStatDataFiles*nGrids files */
00073   int nStatDataFiles;
00074 
00075   /* number of time dependent data files 
00076      the host file will contain nTimeDataFiles*nGrids*nTimeSlices files */
00077   int nTimeDataFiles;
00078 
00079   /* Number time slices in seperate files */
00080   int nTimeSlices;
00081 
00082   /* unique identifier binding the mosaci file layout */
00083   char *uuid;
00084 
00085   /* coordinates_id - Needed to match coordinates_id to other files */
00086   char *coordinates_id;
00087 
00088   /* data_id - Needed to match data_id to other files */
00089   char *data_id;
00090 
00091 };
00092 
00093 #ifdef __cplusplus
00094 extern "C" {
00095 #endif
00096 
00115   int nccf_def_host(const char *coordinates_id, const char *data_id, 
00116                     int nTimeSlices, int *hostid);
00117 
00128 int nccf_add_host_file(int hostid, const char *filename, int force);
00129 
00139 int nccf_def_host_from_file(const char *filename, int *hostid);
00140 
00149 int nccf_free_host(int hostid);
00150 
00160 int nccf_put_host(int ncid, int hostid);
00161 
00171 int nccf_add_host_global_att(int hostid, const char *attname, 
00172                              const char *value);
00173 
00183 int nccf_get_host_global_att( int hostid, const char *attname, char *value );
00184 
00193 int nccf_inq_host_ngrids( int hostid, int *ngrids );
00194 
00203 int nccf_inq_host_nstaticdata( int hostid, int *nstaticdata );
00204 
00213 int nccf_inq_host_ntimedata( int hostid, int *ntimedata );
00214 
00223 int nccf_inq_host_ntimes( int hostid, int *ntimes );
00224 
00234   int nccf_inq_host_statfilename(int hostid, int vfindx, int gfindx, 
00235                                  char *fname);
00246   int nccf_inq_host_timefilename(int hostid, int tfindx, 
00247                                  int vfindx, int gfindx, 
00248                                  char *fname);
00249 
00259 int nccf_inq_host_gridfilename( int hostid, int gfindx, char *filename );
00260 
00270 int nccf_inq_host_gridname( int hostid, int gfindx, char *gridname );
00271 
00280 int nccf_inq_host_mosaicfilename( int hostid, char *mosaicfilename );
00281 
00283 #ifdef __cplusplus
00284 }
00285 #endif /* __cplusplus */
00286 
00287 #endif /* _NCCF_HOST_H */
00288 
 All Classes Files Functions Defines

Generated on Tue Mar 1 2011 06:36:59 for libCF. LibCF is a Unidata library.