Commit c6c1c852 authored by Uwe Schulzweida's avatar Uwe Schulzweida
Browse files

cdilib update

parent 89a0c020
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2007 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2008 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......
......@@ -2,7 +2,7 @@
This file is part of CDO. CDO is a collection of Operators to
manipulate and analyse Climate model Data.
Copyright (C) 2003-2007 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
Copyright (C) 2003-2008 Uwe Schulzweida, Uwe.Schulzweida@zmaw.de
See COPYING file for copying and redistribution conditions.
This program is free software; you can redistribute it and/or modify
......
......@@ -1723,6 +1723,7 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
int gridtype;
int gridsize;
double *vals;
char units[128];
gridtype = gridInqType(gridID);
......@@ -1746,6 +1747,14 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
{
}
gridInqYunits(gridID, units);
if ( strncmp(units, "degrees", 7) == 0 )
units[7] = 0;
else if ( strncmp(units, "radian", 6) == 0 )
units[6] = 0;
else
cdoWarning("Unknown units supplied for grid!");
/* create netCDF dataset for this grid */
nce(nc_create(gridfile, NC_CLOBBER, &nc_file_id));
......@@ -1791,14 +1800,14 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
nce(nc_def_var(nc_file_id, "grid_center_lat", xtype, ndims, nc_dims_id, &nc_gridlat_id));
nce(nc_put_att_text(nc_file_id, nc_gridlat_id, "units", 7, "degrees"));
nce(nc_put_att_text(nc_file_id, nc_gridlat_id, "units", strlen(units), units));
nce(nc_put_att_text(nc_file_id, nc_gridlat_id, "bounds", 15, "grid_corner_lat"));
/* define grid center longitude array */
nce(nc_def_var(nc_file_id, "grid_center_lon", xtype, ndims, nc_dims_id, &nc_gridlon_id));
nce(nc_put_att_text(nc_file_id, nc_gridlon_id, "units", 7, "degrees"));
nce(nc_put_att_text(nc_file_id, nc_gridlon_id, "units", strlen(units), units));
nce(nc_put_att_text(nc_file_id, nc_gridlon_id, "bounds", 15, "grid_corner_lon"));
/* define grid mask */
......@@ -1826,13 +1835,13 @@ void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
nce(nc_def_var(nc_file_id, "grid_corner_lat", xtype, ndims, nc_dims_id, &nc_gridclat_id));
nce(nc_put_att_text(nc_file_id, nc_gridclat_id, "units", 7, "degrees"));
nce(nc_put_att_text(nc_file_id, nc_gridclat_id, "units", strlen(units), units));
/* define grid corner longitude array */
nce(nc_def_var(nc_file_id, "grid_corner_lon", xtype, ndims, nc_dims_id, &nc_gridclon_id));
nce(nc_put_att_text(nc_file_id, nc_gridclon_id, "units", 7, "degrees"));
nce(nc_put_att_text(nc_file_id, nc_gridclon_id, "units", strlen(units), units));
/* end definition stage */
......
......@@ -364,7 +364,7 @@ void *Wct(void *argument);
#define VertintOperators {"ml2pl", "ml2hl"}
#define VertstatOperators {"vertmin", "vertmax", "vertsum", "vertmean", "vertavg", "vertvar", "vertstd"}
#define WindOperators {"uv2dv", "uv2dvl", "dv2uv", "dv2uvl", "dv2ps"}
#define WritegridOperators {"writegrid", "gridarea"}
#define WritegridOperators {"writegrid"}
#define WriterandomOperators {"writerandom"}
#define YhourstatOperators {"yhourmin", "yhourmax", "yhoursum", "yhourmean", "yhouravg", "yhourvar", "yhourstd"}
/* RQ */
......
Supports Markdown
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