plugin_src/data_handler/netcdf.c File Reference

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <netcdf.h>
#include <assert.h>
#include "crusde_api.h"

Include dependency graph for netcdf.c:


Defines

#define NDIMS   4
#define ERRCODE   2
#define ERR(e)   {printf("Error (%s, %d): %s\n", __FILE__, __LINE__, nc_strerror(e)); crusde_exit(ERRCODE);}

Functions

const char * get_name ()
const char * get_version ()
const char * get_authors ()
PluginCategory get_category ()
void request_plugins ()
void register_output_fields ()
const char * get_description ()
void run ()
 Performs the fast convolution.
void clear ()
void init ()
 Initialization of the convolution. Allocation of memory for inputs and outputs.
void register_parameter ()
 Register parameters this Kernel claims from the input.
void set_model_data (double **data, int dim_x, int dim_y)

Variables

int status
int nc_id = -1
int NLAT
int NLON
int NTIM
int NDIR
int lat_dimid = -1
int lon_dimid = -1
int t_dimid = -1
int dir_dimid = -1
int lat_varid = -1
int lon_varid = -1
int data_varid = -1
int t_varid = -1
int dir_varid = -1
int dimids [NDIMS]
double ** data_out
boolean data_written
char * filename
static const char * netcdf_history = "written by CrusDe\'s netCDF Plugin, direction indices are: "
static const char * netcdf_latitude = "latitude"
static const char * netcdf_longitude = "longitude"
static const char * netcdf_longname = "experiment name"
static const char * netcdf_time = "time"
static const char * netcdf_direction = "direction"
static const char * netcdf_deg_east = "degrees_east"
static const char * netcdf_deg_north = "degrees_north"
static const char * netcdf_meters = "m"
static const char * netcdf_days = "days"

Detailed Description

This data handler writes CrusDe results to a 4-D netcdf file following the COARDS conventions ( ftp://ftp.unidata.ucar.edu/pub/netcdf/Conventions/COARDS/coards_conventions ). The four dimensions, and so the dimension names, are:

latitude, longitude, time, direction.

This plugin creates a netCDF file with either the filename given in the experiment definition or the default name for output (experiment.nc) on initialization. At each time step the the model results are saved to this file for all directions (x,y,z, other). The file gets deleted during unloading if no data was written.


Define Documentation

#define ERR (  )     {printf("Error (%s, %d): %s\n", __FILE__, __LINE__, nc_strerror(e)); crusde_exit(ERRCODE);}

#define ERRCODE   2

#define NDIMS   4


Function Documentation

void clear (  ) 

Clean-up before this plug-in gets unloaded.

const char* get_authors (  ) 

PluginCategory get_category (  ) 

returns DATAOUT_PLUGIN

const char* get_description (  ) 

const char* get_name (  ) 

const char* get_version (  ) 

void init (  ) 

Initialization of the convolution. Allocation of memory for inputs and outputs.

This function must not be called before register_parameter() unless none of the necessary values depends on parameters provided by the user, which are only set after they have been registered. This function is called some time after register_parameter().

void register_output_fields (  ) 

empty

void register_parameter (  ) 

Register parameters this Kernel claims from the input.

empty

See also:
register_parameter() (temp_plugin.c.tmp)

void request_plugins (  ) 

empty

void run (  ) 

Performs the fast convolution.

does the writing to the file

void set_model_data ( double **  data,
int  dim_x,
int  dim_y 
)

set pointer to modelling result


Variable Documentation

double** data_out

int data_varid = -1

boolean data_written

int dimids[NDIMS]

int dir_dimid = -1

int dir_varid = -1

char* filename

int lat_dimid = -1

int lat_varid = -1

int lon_dimid = -1

int lon_varid = -1

int nc_id = -1

int NDIR

const char* netcdf_days = "days" [static]

const char* netcdf_deg_east = "degrees_east" [static]

const char* netcdf_deg_north = "degrees_north" [static]

const char* netcdf_direction = "direction" [static]

const char* netcdf_history = "written by CrusDe\'s netCDF Plugin, direction indices are: " [static]

const char* netcdf_latitude = "latitude" [static]

const char* netcdf_longitude = "longitude" [static]

const char* netcdf_longname = "experiment name" [static]

const char* netcdf_meters = "m" [static]

const char* netcdf_time = "time" [static]

int NLAT

int NLON

int NTIM

int status

int t_dimid = -1

int t_varid = -1


Generated on Sun Aug 31 13:19:38 2008 for CrusDe by  doxygen 1.5.0