plugin_src/data_handler/netcdf.c File Reference

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

Include dependency graph for netcdf.c:

Include dependency graph

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 ()
const PluginCategory get_category ()
void request_plugins ()
int 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 lon_dimid=-1 t_dimid=-1 dir_dimid=-1
int lat_varid = -1 lon_varid=-1 data_varid=-1 t_varid=-1 dir_varid=-1
int dimids [NDIMS]
double ** data_out
boolean data_written
const char * filename
const char * netcdf_history = "written by CrusDe\'s netCDF Plugin, direction indices are: "
const char * netcdf_latitude = "latitude"
const char * netcdf_longitude = "longitude"
const char * netcdf_longname = "experiment name"
const char * netcdf_time = "time"
const char * netcdf_direction = "direction"
const char * netcdf_deg_east = "degrees_east"
const char * netcdf_deg_north = "degrees_north"
const char * netcdf_meters = "m"
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  ) 
 

const 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().

int 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
 

boolean data_written
 

int dimids[NDIMS]
 

const char* filename
 

int lat_dimid = -1 lon_dimid=-1 t_dimid=-1 dir_dimid=-1
 

int lat_varid = -1 lon_varid=-1 data_varid=-1 t_varid=-1 dir_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
 


Generated on Sun Jul 29 08:17:29 2007 for CrusDe by doxygen 1.3.8