nco/nco_netcdf.h File Reference

#include <stdio.h>
#include <stdlib.h>
#include <netcdf.h>
#include "nco_typ.h"

Include dependency graph for nco_netcdf.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

const char * c_typ_nm (const nc_type type)
const char * f77_typ_nm (const nc_type type)
const char * f90_typ_nm (const nc_type type)
void nco_dfl_case_nc_type_err (void)
void nco_dfl_case_prg_id_err (void)
void nco_err_exit (const int rcd, const char *const msg)
size_t nco_typ_lng (const nc_type nco_typ)
const char * nco_typ_sng (const nc_type type)
int nco_create (const char *const fl_nm, const int cmode, int *const nc_id)
int nco_open (const char *const fl_nm, const int mode, int *const nc_id)
int nco_redef (const int nc_id)
int nco_set_fill (const int nc_id, const int fill_mode, int *const old_mode)
int nco_enddef (const int nc_id)
int nco__enddef (const int nc_id, const size_t hdr_pad)
int nco_sync (const int nc_id)
int nco_abort (const int nc_id)
int nco_close (const int nc_id)
int nco_inq (const int nc_id, int *const dmn_nbr_fl, int *const var_nbr_fl, int *const att_glb_nbr, int *const rec_dmn_id)
int nco_inq_ndims (const int nc_id, int *const dmn_nbr_fl)
int nco_inq_nvars (const int nc_id, int *const var_nbr_fl)
int nco_inq_natts (const int nc_id, int *const att_glb_nbr)
int nco_inq_unlimdim (const int nc_id, int *const rec_dmn_id)
int nco_def_dim (const int nc_id, const char *const dmn_nm, const long dmn_sz, int *const dmn_id)
int nco_inq_dimid (const int nc_id, const char *const dmn_nm, int *const dmn_id)
int nco_inq_dimid_flg (const int nc_id, const char *const dmn_nm, int *const dmn_id)
int nco_inq_dim (const int nc_id, const int dmn_id, char *dmn_nm, long *dmn_sz)
int nco_inq_dim_flg (const int nc_id, const int dmn_id, char *dmn_nm, long *dmn_sz)
int nco_inq_dimname (const int nc_id, const int dmn_id, char *dmn_nm)
int nco_inq_dimlen (const int nc_id, const int dmn_id, long *dmn_sz)
int nco_rename_dim (const int nc_id, const int dmn_id, const char *const dmn_nm)
int nco_def_var (const int nc_id, const char *const var_nm, const nc_type var_typ, const int dmn_nbr, const int *const dmn_id, int *const var_id)
int nco_inq_var (const int nc_id, const int var_id, char *const var_nm, nc_type *const var_typ, int *const dmn_nbr, int *const dmn_id, int *const nbr_att)
int nco_inq_varid (const int nc_id, const char *const var_nm, int *const var_id)
int nco_inq_varid_flg (const int nc_id, const char *const var_nm, int *const var_id)
int nco_inq_varname (const int nc_id, const int var_id, char *const var_nm)
int nco_inq_vartype (const int nc_id, const int var_id, nc_type *const var_typ)
int nco_inq_varndims (const int nc_id, const int var_id, int *const dmn_nbr)
int nco_inq_vardimid (const int nc_id, const int var_id, int *const dmn_id)
int nco_inq_varnatts (const int nc_id, const int var_id, int *const nbr_att)
int nco_rename_var (const int nc_id, const int var_id, const char *const var_nm)
int nco_copy_var (const int nc_in_id, const int var_id, const int nc_out_id)
int nco_get_var1 (const int nc_id, const int var_id, const long *const srt, void *const vp, const nc_type var_typ)
int nco_put_var1 (const int nc_id, const int var_id, const long *const srt, const void *const vp, const nc_type type)
int nco_get_vara (const int nc_id, const int var_id, const long *const srt, const long *const cnt, void *const vp, const nc_type type)
int nco_put_vara (const int nc_id, const int var_id, const long *const srt, const long *const cnt, const void *const vp, const nc_type type)
int nco_get_varm (const int nc_id, const int var_id, const long *const srt, const long *const cnt, const long *srd, const long *const map, void *const vp, const nc_type type)
int nco_put_varm (const int nc_id, const int var_id, const long *const srt, const long *const cnt, const long *srd, const long *const map, const void *const vp, const nc_type type)
int nco_inq_att (const int nc_id, const int var_id, const char *const att_nm, nc_type *const att_typ, long *const att_sz)
int nco_inq_att_flg (const int nc_id, const int var_id, const char *const att_nm, nc_type *const att_typ, long *const att_sz)
int nco_inq_attid (const int nc_id, const int var_id, const char *const att_nm, int *const att_id)
int nco_inq_attid_flg (const int nc_id, const int var_id, const char *const att_nm, int *const att_id)
int nco_inq_atttype (const int nc_id, const int var_id, const char *const att_nm, nc_type *const att_typ)
int nco_inq_attlen (const int nc_id, const int var_id, const char *const att_nm, long *const att_sz)
int nco_inq_attname (const int nc_id, const int var_id, const int att_id, char *const att_nm)
int nco_copy_att (const int nc_id_in, const int var_id_in, const char *const att_nm, const int nc_id_out, const int var_id_out)
int nco_rename_att (const int nc_id, const int var_id, const char *const att_nm, const char *const att_new_nm)
int nco_del_att (const int nc_id, const int var_id, const char *const att_nm)
int nco_put_att (const int nc_id, const int var_id, const char *const att_nm, const nc_type att_typ, const long att_len, const void *const vp)
int nco_get_att (const int nc_id, const int var_id, const char *const att_nm, void *const vp, const nc_type att_typ)


Function Documentation

const char* c_typ_nm const nc_type  type  ) 
 

Definition at line 158 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), and type.

Referenced by nco_bnr_wrt().

00159 {
00160   /* Purpose: Divine internal (native) C type string from netCDF external type enum
00161      fxm: This breaks on Crays where both NC_FLOAT and NC_DOUBLE are native type float
00162      fxm: Modify this to handle different opaque types correctly
00163      This may mean defining tokens containing opaque type names in nco_typ.h */
00164   switch(type){
00165   case NC_FLOAT:
00166     return "float";
00167   case NC_DOUBLE:
00168     return "double";
00169   case NC_INT:
00170     return "NCO_INT_SNG";
00171   case NC_SHORT:
00172     return "signed short int";
00173   case NC_CHAR:
00174     return "NCO_CHAR_SNG";
00175   case NC_BYTE:
00176     return "NCO_BYTE_SNG";
00177   case NC_UBYTE:
00178     return "NCO_UBYTE_SNG";
00179   case NC_USHORT:
00180     return "NCO_USHORT_SNG";
00181   case NC_UINT:
00182     return "NCO_UINT_SNG";
00183   case NC_INT64:
00184     return "NCO_INT64_SNG";
00185   case NC_UINT64:
00186     return "NCO_UINT64_SNG";
00187   default: nco_dfl_case_nc_type_err(); break;
00188   } /* end switch */
00189 
00190   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
00191   return (char *)NULL;
00192 } /* end c_typ_nm() */

const char* f77_typ_nm const nc_type  type  ) 
 

Definition at line 196 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), and type.

00197 {
00198   /* Purpose: Divine internal (native) Fortran type string from netCDF external type enum */
00199   switch(type){
00200   case NC_FLOAT:
00201     return "real*4";
00202   case NC_DOUBLE:
00203     return "real*8";
00204   case NC_INT:
00205     return "integer*4";
00206   case NC_SHORT:
00207     return "integer*2";
00208   case NC_CHAR:
00209     return "character";
00210   case NC_BYTE:
00211     return "character";
00212   case NC_UBYTE:
00213     return "character";
00214   case NC_USHORT:
00215     return "integer*2";
00216   case NC_UINT:
00217     return "integer*4";
00218   case NC_INT64:
00219     return "integer*8";
00220   case NC_UINT64:
00221     return "integer*8";
00222   default: nco_dfl_case_nc_type_err(); break;
00223   } /* end switch */
00224 
00225   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
00226   return (char *)NULL;
00227 } /* end f77_typ_nm() */

const char* f90_typ_nm const nc_type  type  ) 
 

Definition at line 231 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), and type.

00232 {
00233   /* Purpose: Divine internal (native) Fortran type string from netCDF external type enum */
00234   switch(type){
00235   case NC_FLOAT:
00236     return "real(selected_real_kind(p=6))";
00237   case NC_DOUBLE:
00238     return "real(selected_real_kind(p=12))";
00239   case NC_INT:
00240     return "integer(selected_int_kind(6))";
00241   case NC_SHORT:
00242     return "integer(selected_int_kind(2))";
00243   case NC_CHAR:
00244     return "character(1)";
00245   case NC_BYTE:
00246     return "character(1)";
00247   case NC_UBYTE:
00248     return "character(1)";
00249     /* NB: Not sure about generality of integer kinds */
00250   case NC_USHORT:
00251     return "integer(selected_int_kind(2))";
00252   case NC_UINT:
00253     return "integer(selected_int_kind(6))";
00254   case NC_INT64:
00255     return "integer(selected_int_kind(8))";
00256   case NC_UINT64:
00257     return "integer(selected_int_kind(8))";
00258   default: nco_dfl_case_nc_type_err(); break;
00259   } /* end switch */
00260 
00261   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
00262   return (char *)NULL;
00263 } /* end f90_typ_nm() */

int nco__enddef const int  nc_id,
const size_t  hdr_pad
 

Definition at line 388 of file nco_netcdf.c.

References nc__enddef, NC_NOERR, and nco_err_exit().

Referenced by main().

00390 {
00391   /* Purpose: Wrapper for nc__enddef() */
00392   int rcd;
00393   /* hdr_pad is netCDF library h_minfree variable */
00394   const size_t v_align=4UL; /* [B] Alignment of beginning of data section for fixed variables */
00395   const size_t v_minfree=0UL; /* [B] Pad at end of data section for fixed size variables */
00396   const size_t r_align=4UL; /* [B] Alignment of beginning of data section for record variables */
00397   /* nc_enddef(ncid) is equivalent to nc__enddef(ncid,0,4,0,4) */
00398   rcd=nc__enddef(nc_id,hdr_pad,v_align,v_minfree,r_align);
00399   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco__enddef");
00400   return rcd;
00401 } /* end nco__enddef */

int nco_abort const int  nc_id  ) 
 

Definition at line 414 of file nco_netcdf.c.

References nc_abort, NC_NOERR, and nco_err_exit().

00415 {
00416   /* Purpose: Wrapper for nc_abort() */
00417   int rcd;
00418   rcd=nc_abort(nc_id);
00419   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_abort");
00420   return rcd;
00421 } /* end nco_abort */

int nco_close const int  nc_id  ) 
 

Definition at line 424 of file nco_netcdf.c.

References nc_close, NC_NOERR, and nco_err_exit().

00425 {
00426   /* Purpose: Wrapper for nc_close() */
00427   const char fnc_nm[]="nco_close()";
00428   int rcd=NC_NOERR;
00429   rcd=nc_close(nc_id);
00430   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
00431   return rcd;
00432 } /* end nco_close */

int nco_copy_att const int  nc_id_in,
const int  var_id_in,
const char *const   att_nm,
const int  nc_id_out,
const int  var_id_out
 

Definition at line 929 of file nco_netcdf.c.

References nc_copy_att, NC_NOERR, and nco_err_exit().

Referenced by nco_att_cpy().

00930 {
00931   /* Purpose: Wrapper for nc_copy_att() */
00932   int rcd;
00933   rcd=nc_copy_att(nc_id_in,var_id_in,att_nm,nc_id_out,var_id_out);
00934   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_copy_att");
00935   return rcd;
00936 }  /* end nco_copy_att */

int nco_copy_var const int  nc_in_id,
const int  var_id,
const int  nc_out_id
 

Definition at line 679 of file nco_netcdf.c.

References nc_copy_var, NC_NOERR, and nco_err_exit().

00680 {
00681   /* Purpose: Wrapper for nc_copy_var() */
00682   int rcd;
00683   rcd=nc_copy_var(nc_in_id,var_id,nc_out_id);
00684   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_copy_var");
00685   return rcd;
00686 } /* end nco_copy_var */

int nco_create const char *const   fl_nm,
const int  cmode,
int *const   nc_id
 

Definition at line 304 of file nco_netcdf.c.

References nc_create, NC_NOERR, and nco_err_exit().

00305 {
00306   /* Purpose: Wrapper for nc_create() */
00307   const char fnc_nm[]="nco_create()";
00308   int rcd;
00309   rcd=nc_create(fl_nm,cmode,nc_id);
00310   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
00311   return rcd;
00312 } /* end nco_create */

int nco_def_dim const int  nc_id,
const char *const   dmn_nm,
const long  dmn_sz,
int *const   dmn_id
 

Definition at line 487 of file nco_netcdf.c.

References nc_def_dim, NC_NOERR, and nco_err_exit().

00488 {
00489   /* Purpose: Wrapper for nc_def_dim() */
00490   int rcd;
00491   rcd=nc_def_dim(nc_id,dmn_nm,(size_t)dmn_sz,dmn_id);
00492   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_def_dim");
00493   return rcd;
00494 } /* end nco_def_dim */

int nco_def_var const int  nc_id,
const char *const   var_nm,
const nc_type  var_typ,
const int  dmn_nbr,
const int *const   dmn_id,
int *const   var_id
 

Definition at line 576 of file nco_netcdf.c.

References nc_def_var, NC_NOERR, and nco_err_exit().

00577 {
00578   /* Purpose: Wrapper for nc_def_var() */
00579   int rcd;
00580   rcd=nc_def_var(nc_id,var_nm,var_typ,dmn_nbr,dmn_id,var_id);
00581   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_def_var");
00582   return rcd;
00583 } /* end nco_def_var */

int nco_del_att const int  nc_id,
const int  var_id,
const char *const   att_nm
 

Definition at line 949 of file nco_netcdf.c.

References nc_del_att, NC_NOERR, and nco_err_exit().

Referenced by nco_aed_prc().

00950 {
00951   /* Purpose: Wrapper for nc_del_att() */
00952   int rcd;
00953   rcd=nc_del_att(nc_id,var_id,att_nm);
00954   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_del_att");
00955   return rcd;
00956 } /* end nco_del_att */

void nco_dfl_case_nc_type_err void   ) 
 

Definition at line 266 of file nco_netcdf.c.

References nco_err_exit().

Referenced by c_typ_nm(), cast_nctype_void(), cast_void_nctype(), f77_typ_nm(), f90_typ_nm(), main(), ncap_scv_2_ptr_unn(), ncap_scv_abs(), ncap_scv_clc(), ncap_scv_minus(), ncap_var_fnc(), nco_aed_prc(), nco_cmp_ptr_unn(), nco_fl_out_open(), nco_get_att(), nco_get_var1(), nco_get_vara(), nco_get_varm(), nco_is_packable(), nco_lmt_evl(), nco_mmr_typ_sng(), nco_msa_prn_var_val(), nco_mss_val_cnf(), nco_mss_val_mk(), nco_pck_plc_typ_get(), nco_prn_att(), nco_prn_var_val_lmt(), nco_prs_aed_lst(), nco_put_att(), nco_put_var1(), nco_put_vara(), nco_put_varm(), nco_scv_cnf_typ(), nco_typ_fmt_sng(), nco_typ_lng(), nco_typ_sng(), nco_val_cnf_typ(), nco_var_abs(), nco_var_add(), nco_var_add_tll_ncflint(), nco_var_add_tll_ncra(), nco_var_avg_reduce_max(), nco_var_avg_reduce_min(), nco_var_avg_reduce_ttl(), nco_var_cnf_typ(), nco_var_dvd(), nco_var_max_bnr(), nco_var_min_bnr(), nco_var_mlt(), nco_var_mod(), nco_var_msk(), nco_var_nrm(), nco_var_nrm_sdn(), nco_var_pck(), nco_var_pwr(), nco_var_sbt(), nco_var_sqrt(), nco_var_zero(), ptr_unn_2_scv(), rec_crd_chk(), scl_mk_var(), scv_var_dvd(), scv_var_mod(), scv_var_pwr(), var_scv_add(), var_scv_dvd(), var_scv_mlt(), var_scv_mod(), var_scv_pwr(), var_scv_sub(), and vec_set().

00267 {
00268   /* Purpose: Convenience routine for printing error and exiting when
00269      switch(nctype) statement receives an illegal default case
00270      NCO emits warnings when compiled by GCC with -DNETCDF2_ONLY since,
00271      apparently, there are a whole bunch of things besides numeric
00272      types in the old nctype enum and gcc warns about enums that are
00273      not exhaustively considered in switch() statements.
00274      All these default statements can be removed with netCDF3 interface
00275      so perhaps these should be surrounded with #ifdef NETCDF2_ONLY
00276      constructs, but they actually do make sense for netCDF3 as well
00277      so I have implemented a uniform error function, nco_dfl_case_nc_type_err(),
00278      to be called by all routines which emit errors only when compiled with
00279      NETCDF2_ONLY.
00280      This makes the behavior easy to modify or remove in the future.
00281 
00282      Placing this in its own routine also has the virtue of saving many lines
00283      of code since this function is used in many many switch() statements. */
00284   const char fnc_nm[]="nco_dfl_case_nc_type_err()";
00285   (void)fprintf(stdout,"%s: ERROR switch(nctype) statement fell through to default case, which is illegal.\nNot handling the default case causes gcc to emit warnings when compiling NCO with the NETCDF2_ONLY token (because nctype definition is braindead in netCDF2.x). Exiting...\n",fnc_nm);
00286   nco_err_exit(0,fnc_nm);
00287 } /* end nco_dfl_case_nc_type_err() */

void nco_dfl_case_prg_id_err void   ) 
 

Definition at line 290 of file nco_netcdf.c.

References nco_err_exit().

Referenced by nco_fl_lst_mk(), nco_is_mlt_fl_opr(), nco_is_rth_opr(), nco_openmp_ini(), nco_usg_prn(), and nco_var_lst_dvd().

00291 {
00292   /* Purpose: Convenience routine for printing error and exiting when
00293      switch(prg_id) statement receives an illegal default case
00294 
00295      Placing this in its own routine also has the virtue of saving many lines
00296      of code since this function is used in many many switch() statements. */
00297   const char fnc_nm[]="nco_dfl_case_prg_id_err()";
00298   (void)fprintf(stdout,"%s: ERROR switch(prg_id) statement fell through to default case, which is unsafe. This catch-all error handler ensures all switch(prg_id) statements are fully enumerated. Exiting...\n",fnc_nm);
00299   nco_err_exit(0,fnc_nm);
00300 } /* end nco_dfl_case_prg_id_err() */

int nco_enddef const int  nc_id  ) 
 

Definition at line 377 of file nco_netcdf.c.

References nc_enddef, NC_NOERR, and nco_err_exit().

00378 {
00379   /* Purpose: Wrapper for nc_enddef() */
00380   int rcd;
00381   rcd=nc_enddef(nc_id);
00382   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_enddef");
00383   return rcd;
00384 } /* end nco_enddef */

void nco_err_exit const int  rcd,
const char *const   msg
 

Definition at line 40 of file nco_netcdf.c.

References EXIT_FAILURE, NC_ERANGE, NC_NOERR, and nc_strerror.

00042 {
00043   /* Purpose: Print netCDF error message, routine name, then exit(EXIT_FAILURE) or abort()
00044      Routine is called by all wrappers when fatal error is encountered
00045      Goal is to have all NCO error exits to go through nco_err_exit()
00046      This provides uniform handling of exit() status and abort() option
00047      Successful NCO exits should call nco_exit() not nco_err_exit()
00048 
00049      msg variable allows wrapper to pass more descriptive information than
00050      is contained in the netCDF-defined error message.
00051      Use msg to print, e.g., the name of variable or routine which caused error */
00052 
00053   const char fnc_nm[]="nco_err_exit()";
00054 #ifdef NCO_ABORT_ON_ERROR
00055   const char exit_fnc_nm[]="abort()";
00056 #else /* !NCO_ABORT_ON_ERROR */
00057   const char exit_fnc_nm[]="exit(EXIT_FAILURE)";
00058 #endif /* !NCO_ABORT_ON_ERROR */
00059 
00060   switch(rcd){
00061   case NC_ERANGE: (void)fprintf(stdout,"ERROR Result not representable in output file\nHINT: This may occur when an arithmetic operation results in a value not representible by the output variable type and NCO attempts to write that variable to an output file, with, e.g., nc_put_var*(). For more details, see\nhttp://nco.sf.net/nco.html#typ_cnv\n\nPossible workaround: Permanently promote the variable before attempting the arithmetic operation. For example,\nncap -O -s \'foo=double(foo);\' in.nc in.nc\n"); break;
00062   } /* end switch */
00063 
00064   (void)fprintf(stdout,"ERROR: program exiting through %s which will now call %s\n",fnc_nm,exit_fnc_nm);
00065 
00066   /* On occasion, routine is called with non-netCDF errors, e.g., by nco_dfl_case_nc_type_err()
00067      non-netCDF errors call nco_err_exit() with rcd == 0
00068      Only attempt to print netCDF error messages when rcd != 0 */
00069   if(rcd != NC_NOERR) (void)fprintf(stderr,"%s: ERROR %s\n%s\n",fnc_nm,msg,nc_strerror(rcd));
00070 #ifdef NCO_ABORT_ON_ERROR
00071   /* abort() produces core dump and traceback information
00072      Most debuggers (e.g., gdb) use this information to print the calling tree that produced the abort()
00073      This makes debugging much easier!
00074      Hence we recommend developers compile NCO with -DNCO_ABORT_ON_ERROR */
00075   abort();
00076 #else /* !NCO_ABORT_ON_ERROR */
00077   /* exit() produces no core dump or useful debugger information
00078      It is slightly more friendly to the end-user since it does not leave core files laying around
00079      Hence we recommend installing NCO without -DNCO_ABORT_ON_ERROR for end users */
00080   exit(EXIT_FAILURE);
00081 #endif /* !NCO_ABORT_ON_ERROR */
00082 } /* end nco_err_exit() */

int nco_get_att const int  nc_id,
const int  var_id,
const char *const   att_nm,
void *const   vp,
const nc_type  att_typ
 

Definition at line 985 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, nc_get_att_double, nc_get_att_float, nc_get_att_short, NC_INT, NC_INT64, NC_NOERR, NC_SHORT, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_GET_ATT_BYTE, NCO_GET_ATT_CHAR, NCO_GET_ATT_INT, NCO_GET_ATT_INT64, NCO_GET_ATT_UINT, NCO_GET_ATT_UINT64, and NCO_GET_ATT_USHORT.

00986 {
00987   /* Purpose: Wrapper for nc_get_att_*() */
00988   int rcd=NC_NOERR;
00989   switch(att_typ){
00990   case NC_FLOAT: rcd=nc_get_att_float(nc_id,var_id,att_nm,(float *)vp); break;
00991   case NC_DOUBLE: rcd=nc_get_att_double(nc_id,var_id,att_nm,(double *)vp); break;
00992   case NC_INT: rcd=NCO_GET_ATT_INT(nc_id,var_id,att_nm,(nco_int *)vp); break;
00993   case NC_SHORT: rcd=nc_get_att_short(nc_id,var_id,att_nm,(short *)vp); break;
00994   case NC_CHAR: rcd=NCO_GET_ATT_CHAR(nc_id,var_id,att_nm,(nco_char *)vp); break;
00995   case NC_BYTE: rcd=NCO_GET_ATT_BYTE(nc_id,var_id,att_nm,(nco_byte *)vp); break;
00996 #ifdef ENABLE_NETCDF4
00997     /* 20051119: netcdf4 library did not support these until alpha10, still does not support nco_put/get_att_ubyte() */
00998     /*  case NC_UBYTE: rcd=NCO_GET_ATT_UBYTE(nc_id,var_id,att_nm,(nco_ubyte *)vp); break;*/
00999   case NC_USHORT: rcd=NCO_GET_ATT_USHORT(nc_id,var_id,att_nm,(nco_ushort *)vp); break;
01000   case NC_UINT: rcd=NCO_GET_ATT_UINT(nc_id,var_id,att_nm,(nco_uint *)vp); break;
01001   case NC_INT64: rcd=NCO_GET_ATT_INT64(nc_id,var_id,att_nm,(nco_int64 *)vp); break;
01002   case NC_UINT64: rcd=NCO_GET_ATT_UINT64(nc_id,var_id,att_nm,(nco_uint64 *)vp); break;
01003 #endif /* !ENABLE_NETCDF4 */
01004   default: nco_dfl_case_nc_type_err(); break;
01005   } /* end switch */
01006   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_att");
01007   return rcd;
01008 } /* end nco_get_att */

int nco_get_var1 const int  nc_id,
const int  var_id,
const long *const   srt,
void *const   vp,
const nc_type  var_typ
 

Definition at line 692 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, nc_get_var1_double, nc_get_var1_float, nc_get_var1_short, NC_INT, NC_INT64, NC_NOERR, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_GET_VAR1_BYTE, NCO_GET_VAR1_CHAR, NCO_GET_VAR1_INT, NCO_GET_VAR1_INT64, NCO_GET_VAR1_UBYTE, NCO_GET_VAR1_UINT, NCO_GET_VAR1_UINT64, and NCO_GET_VAR1_USHORT.

Referenced by arm_base_time_get(), arm_time_mk(), nco_aed_prc(), nco_cnv_ccm_ccsm_cf_date(), nco_cpy_var_val(), nco_cpy_var_val_lmt(), nco_cpy_var_val_mlt_lmt(), nco_msa_prn_var_val(), nco_prn_var_val_lmt(), nco_var_get(), and nco_var_val_cpy().

00693 {
00694   /* Purpose: Wrapper for nc_get_var1_*() */
00695   int rcd=NC_NOERR;
00696   switch(var_typ){
00697   case NC_FLOAT: rcd=nc_get_var1_float(nc_id,var_id,(const size_t *)srt,(float *)vp); break;
00698   case NC_DOUBLE: rcd=nc_get_var1_double(nc_id,var_id,(const size_t *)srt,(double *)vp); break;
00699   case NC_INT: rcd=NCO_GET_VAR1_INT(nc_id,var_id,(const size_t *)srt,(nco_int *)vp); break;
00700   case NC_SHORT: rcd=nc_get_var1_short(nc_id,var_id,(const size_t *)srt,(short *)vp); break;
00701   case NC_CHAR: rcd=NCO_GET_VAR1_CHAR(nc_id,var_id,(const size_t *)srt,(nco_char *)vp); break;
00702   case NC_BYTE: rcd=NCO_GET_VAR1_BYTE(nc_id,var_id,(const size_t *)srt,(nco_byte *)vp); break;
00703 #ifdef ENABLE_NETCDF4
00704   case NC_UBYTE: rcd=NCO_GET_VAR1_UBYTE(nc_id,var_id,(const size_t *)srt,(nco_ubyte *)vp); break;
00705   case NC_USHORT: rcd=NCO_GET_VAR1_USHORT(nc_id,var_id,(const size_t *)srt,(nco_ushort *)vp); break;
00706   case NC_UINT: rcd=NCO_GET_VAR1_UINT(nc_id,var_id,(const size_t *)srt,(nco_uint *)vp); break;
00707   case NC_INT64: rcd=NCO_GET_VAR1_INT64(nc_id,var_id,(const size_t *)srt,(nco_int64 *)vp); break;
00708   case NC_UINT64: rcd=NCO_GET_VAR1_UINT64(nc_id,var_id,(const size_t *)srt,(nco_uint64 *)vp); break;
00709 #endif /* !ENABLE_NETCDF4 */
00710   default: nco_dfl_case_nc_type_err(); break;
00711   } /* end switch */
00712   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_var1");
00713   return rcd;
00714 } /* end nco_get_var1 */

int nco_get_vara const int  nc_id,
const int  var_id,
const long *const   srt,
const long *const   cnt,
void *const   vp,
const nc_type  type
 

Definition at line 742 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, nc_get_vara_double, nc_get_vara_float, nc_get_vara_short, NC_INT, NC_INT64, NC_NOERR, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_GET_VARA_BYTE, NCO_GET_VARA_CHAR, NCO_GET_VARA_INT, NCO_GET_VARA_INT64, NCO_GET_VARA_UBYTE, NCO_GET_VARA_UINT, NCO_GET_VARA_UINT64, and NCO_GET_VARA_USHORT.

Referenced by nco_aed_prc(), nco_arm_time_install(), nco_cpy_var_val(), nco_cpy_var_val_lmt(), nco_lmt_evl(), nco_msa_rec_clc(), nco_prn_var_val_lmt(), nco_var_get(), and nco_var_val_cpy().

00743 {
00744   /* Purpose: Wrapper for nc_get_vara_*() */
00745   int rcd=NC_NOERR;
00746   switch(type){
00747   case NC_FLOAT: rcd=nc_get_vara_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(float *)vp); break;
00748   case NC_DOUBLE: rcd=nc_get_vara_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(double *)vp); break;
00749   case NC_INT: rcd=NCO_GET_VARA_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_int *)vp); break;
00750   case NC_SHORT: rcd=nc_get_vara_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(short *)vp); break;
00751   case NC_CHAR: rcd=NCO_GET_VARA_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_char *)vp); break;
00752   case NC_BYTE: rcd=NCO_GET_VARA_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_byte *)vp); break;
00753 #ifdef ENABLE_NETCDF4
00754   case NC_UBYTE: rcd=NCO_GET_VARA_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_ubyte *)vp); break;
00755   case NC_USHORT: rcd=NCO_GET_VARA_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_ushort *)vp); break;
00756   case NC_UINT: rcd=NCO_GET_VARA_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_uint *)vp); break;
00757   case NC_INT64: rcd=NCO_GET_VARA_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_int64 *)vp); break;
00758   case NC_UINT64: rcd=NCO_GET_VARA_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(nco_uint64 *)vp); break;
00759 #endif /* !ENABLE_NETCDF4 */
00760   default: nco_dfl_case_nc_type_err(); break;
00761   } /* end switch */
00762   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_vara");
00763   return rcd;
00764 } /* end nco_get_vara */

int nco_get_varm const int  nc_id,
const int  var_id,
const long *const   srt,
const long *const   cnt,
const long *  srd,
const long *const   map,
void *const   vp,
const nc_type  type
 

Definition at line 792 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, nc_get_varm_double, nc_get_varm_float, nc_get_varm_short, NC_INT, NC_INT64, NC_NOERR, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_GET_VARM_BYTE, NCO_GET_VARM_CHAR, NCO_GET_VARM_INT, NCO_GET_VARM_INT64, NCO_GET_VARM_UBYTE, NCO_GET_VARM_UINT, NCO_GET_VARM_UINT64, and NCO_GET_VARM_USHORT.

Referenced by nco_cpy_var_val_lmt(), nco_msa_rec_clc(), and nco_prn_var_val_lmt().

00793 {
00794   /* Purpose: Wrapper for nc_get_varm_*() */
00795   int rcd=NC_NOERR;
00796 
00797   switch(type){
00798   case NC_FLOAT: rcd=nc_get_varm_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(float *)vp); break;
00799   case NC_DOUBLE: rcd=nc_get_varm_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(double *)vp); break;
00800   case NC_INT: rcd=NCO_GET_VARM_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_int *)vp); break;
00801   case NC_SHORT: rcd=nc_get_varm_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(short *)vp); break;
00802   case NC_CHAR: rcd=NCO_GET_VARM_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_char *)vp); break;
00803   case NC_BYTE: rcd=NCO_GET_VARM_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_byte *)vp); break;
00804 #ifdef ENABLE_NETCDF4
00805   case NC_UBYTE: rcd=NCO_GET_VARM_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_ubyte *)vp); break;
00806   case NC_USHORT: rcd=NCO_GET_VARM_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_ushort *)vp); break;
00807   case NC_UINT: rcd=NCO_GET_VARM_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_uint *)vp); break;
00808   case NC_INT64: rcd=NCO_GET_VARM_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_int64 *)vp); break;
00809   case NC_UINT64: rcd=NCO_GET_VARM_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(nco_uint64 *)vp); break;
00810 #endif /* !ENABLE_NETCDF4 */
00811   default: nco_dfl_case_nc_type_err(); break;
00812   } /* end switch */
00813   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_get_varm");
00814   return rcd;
00815 } /* end nco_get_varm */

int nco_inq const int  nc_id,
int *const   dmn_nbr_fl,
int *const   var_nbr_fl,
int *const   att_glb_nbr,
int *const   rec_dmn_id
 

Definition at line 435 of file nco_netcdf.c.

References nc_inq, NC_NOERR, and nco_err_exit().

00436 {
00437   /* Purpose: Wrapper for nc_inq() */
00438   int rcd;
00439   rcd=nc_inq(nc_id,dmn_nbr_fl,var_nbr_fl,att_glb_nbr,rec_dmn_id);
00440   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq");
00441   return rcd;
00442 } /* end nco_inq */

int nco_inq_att const int  nc_id,
const int  var_id,
const char *const   att_nm,
nc_type *const   att_typ,
long *const   att_sz
 

Definition at line 845 of file nco_netcdf.c.

References nc_inq_att, NC_NOERR, and nco_err_exit().

00846 {
00847   /* Purpose: Wrapper for nc_inq_att() */
00848   const char fnc_nm[]="nco_inq_att()";
00849   int rcd;
00850   rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,(size_t *)att_sz);
00851   if(rcd != NC_NOERR){
00852     (void)fprintf(stderr,"ERROR: %s unable to inquire attribute var_id: %d, att_nm: %s\n",fnc_nm,var_id,att_nm);
00853     nco_err_exit(rcd,fnc_nm);
00854   } /* endif */
00855   return rcd;
00856 } /* end nco_inq_att */

int nco_inq_att_flg const int  nc_id,
const int  var_id,
const char *const   att_nm,
nc_type *const   att_typ,
long *const   att_sz
 

Definition at line 859 of file nco_netcdf.c.

References NC_ENOTATT, nc_inq_att, NC_NOERR, and nco_err_exit().

Referenced by ncap_att_init(), nco_aed_prc(), nco_att_cpy(), nco_cnv_ccm_ccsm_cf_inq(), and nco_pck_dsk_inq().

00860 {
00861   /* Purpose: Wrapper for nc_inq_att() */
00862   const char fnc_nm[]="nco_inq_att_flg()";
00863   int rcd;
00864   rcd=nc_inq_att(nc_id,var_id,att_nm,att_typ,(size_t *)att_sz);
00865   if(rcd == NC_ENOTATT) return rcd;
00866   if(rcd != NC_NOERR){
00867     (void)fprintf(stderr,"ERROR: %s unable to inquire attribute var_id: %d, att_nm: %s\n",fnc_nm,var_id,att_nm);
00868     nco_err_exit(rcd,fnc_nm);
00869   } /* endif */
00870   return rcd;
00871 } /* end nco_inq_att_flg */

int nco_inq_attid const int  nc_id,
const int  var_id,
const char *const   att_nm,
int *const   att_id
 

Definition at line 874 of file nco_netcdf.c.

References nc_inq_attid, NC_NOERR, and nco_err_exit().

00875 {
00876   /* Purpose: Wrapper for nc_inq_attid() */
00877   int rcd;
00878   rcd=nc_inq_attid(nc_id,var_id,att_nm,att_id);
00879   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_attid");
00880   return rcd;
00881 } /* end nco_inq_attid */

int nco_inq_attid_flg const int  nc_id,
const int  var_id,
const char *const   att_nm,
int *const   att_id
 

Definition at line 884 of file nco_netcdf.c.

References NC_ENOTATT, nc_inq_attid, NC_NOERR, and nco_err_exit().

Referenced by main(), nco_msa_prn_var_val(), and nco_prn_var_val_lmt().

00885 {
00886   /* Purpose: Wrapper for nc_inq_attid() */
00887   const char fnc_nm[]="nco_inq_attid_flg()";
00888   int rcd;
00889   rcd=nc_inq_attid(nc_id,var_id,att_nm,att_id);
00890   if(rcd == NC_ENOTATT) return rcd;
00891   if(rcd != NC_NOERR){
00892     (void)fprintf(stderr,"ERROR: %s unable to inquire attribute var_id: %d, att_nm: %s\n",fnc_nm,var_id,att_nm);
00893     nco_err_exit(rcd,fnc_nm);
00894   } /* endif */
00895   return rcd;
00896 } /* end nco_inq_attid_flg */

int nco_inq_attlen const int  nc_id,
const int  var_id,
const char *const   att_nm,
long *const   att_sz
 

Definition at line 909 of file nco_netcdf.c.

References nc_inq_attlen, NC_NOERR, and nco_err_exit().

00910 {
00911   /* Purpose: Wrapper for nc_inq_attlen() */
00912   int rcd;
00913   rcd=nc_inq_attlen(nc_id,var_id,att_nm,(size_t *)att_sz);
00914   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_attlen");
00915   return rcd;
00916 } /* end nco_inq_attlen */

int nco_inq_attname const int  nc_id,
const int  var_id,
const int  att_id,
char *const   att_nm
 

Definition at line 919 of file nco_netcdf.c.

References nc_inq_attname, NC_NOERR, and nco_err_exit().

00920 {
00921   /* Purpose: Wrapper for nc_inq_attname() */
00922   int rcd;
00923   rcd=nc_inq_attname(nc_id,var_id,att_id,att_nm);
00924   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_attname");
00925   return rcd;
00926 } /* end nco_inq_attname */

int nco_inq_atttype const int  nc_id,
const int  var_id,
const char *const   att_nm,
nc_type *const   att_typ
 

Definition at line 899 of file nco_netcdf.c.

References nc_inq_atttype, NC_NOERR, and nco_err_exit().

00900 {
00901   /* Purpose: Wrapper for nc_inq_atttype() */
00902   int rcd;
00903   rcd=nc_inq_atttype(nc_id,var_id,att_nm,att_typ);
00904   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_atttype");
00905   return rcd;
00906 } /* end nco_inq_atttype */

int nco_inq_dim const int  nc_id,
const int  dmn_id,
char *  dmn_nm,
long *  dmn_sz
 

Definition at line 523 of file nco_netcdf.c.

References nc_inq_dim, NC_NOERR, and nco_err_exit().

00524 {
00525   /* Purpose: Wrapper for nc_inq_dim() */
00526   int rcd;
00527   rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,(size_t *)dmn_sz);
00528   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dim");
00529   return rcd;
00530 }/* end nco_inq_dim */

int nco_inq_dim_flg const int  nc_id,
const int  dmn_id,
char *  dmn_nm,
long *  dmn_sz
 

Definition at line 533 of file nco_netcdf.c.

References NC_EBADDIM, nc_inq_dim, NC_NOERR, and nco_err_exit().

Referenced by nco_lmt_sct_mk().

00534 {
00535   /* Purpose: Wrapper for nc_inq_dim_flg() which does not require success */
00536   int rcd;
00537   rcd=nc_inq_dim(nc_id,dmn_id,dmn_nm,(size_t *)dmn_sz);
00538   if(rcd == NC_EBADDIM) return rcd;
00539   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dim_flg");
00540   return rcd;
00541 }/* end nco_inq_dim */

int nco_inq_dimid const int  nc_id,
const char *const   dmn_nm,
int *const   dmn_id
 

Definition at line 497 of file nco_netcdf.c.

References NC_EBADDIM, nc_inq_dimid, NC_NOERR, and nco_err_exit().

00498 {
00499   /* Purpose: Wrapper for nc_inq_dimid() */
00500   const char fnc_nm[]="nco_inq_dimid()";
00501   int rcd;
00502   rcd=nc_inq_dimid(nc_id,dmn_nm,dmn_id);
00503   if(rcd == NC_EBADDIM){
00504     (void)fprintf(stdout,"ERROR: %s reports requested dimension \"%s\" is not in input file\n",fnc_nm,dmn_nm);
00505     nco_err_exit(rcd,fnc_nm);
00506   } /* endif */
00507   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
00508   return rcd;
00509 } /* end nco_inq_dimid */

int nco_inq_dimid_flg const int  nc_id,
const char *const   dmn_nm,
int *const   dmn_id
 

Definition at line 512 of file nco_netcdf.c.

References NC_EBADDIM, nc_inq_dimid, NC_NOERR, and nco_err_exit().

Referenced by arm_inq(), main(), nco_arm_time_install(), nco_cpy_var_dfn(), nco_cpy_var_dfn_lmt(), nco_dmn_dfn(), and nco_lmt_evl().

00513 {
00514   /* Purpose: Wrapper for nc_inq_dimid() which does not require success */
00515   int rcd;
00516   rcd=nc_inq_dimid(nc_id,dmn_nm,dmn_id);
00517   if(rcd == NC_EBADDIM) return rcd;
00518   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dimid_flg");
00519   return rcd;
00520 } /* end nco_inq_dimid */

int nco_inq_dimlen const int  nc_id,
const int  dmn_id,
long *  dmn_sz
 

Definition at line 554 of file nco_netcdf.c.

References nc_inq_dimlen, NC_NOERR, and nco_err_exit().

00555 {
00556   /* Purpose: Wrapper for nc_inq_dimlen() */
00557   int rcd;
00558   rcd=nc_inq_dimlen(nc_id,dmn_id,(size_t *)dmn_sz);
00559   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dimlen");
00560   return rcd;
00561 } /* end nco_inq_dimlen */

int nco_inq_dimname const int  nc_id,
const int  dmn_id,
char *  dmn_nm
 

Definition at line 544 of file nco_netcdf.c.

References nc_inq_dimname, NC_NOERR, and nco_err_exit().

Referenced by ncap_var_init(), nco_cpy_var_val_lmt(), nco_dmn_lst(), nco_dmn_lst_ass_var(), nco_nm_id_lst_crd_make(), nco_var_fll(), nco_var_lst_add_crd(), nco_var_lst_ass_crd_add(), and nco_var_lst_crd_xcl().

00545 {
00546   /* Purpose: Wrapper for nc_inq_dimname() */
00547   int rcd;
00548   rcd=nc_inq_dimname(nc_id,dmn_id,dmn_nm);
00549   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_dimname");
00550   return rcd;
00551 } /* end nco_inq_dimname */

int nco_inq_natts const int  nc_id,
int *const   att_glb_nbr
 

Definition at line 465 of file nco_netcdf.c.

References nc_inq_natts, NC_NOERR, and nco_err_exit().

00466 {
00467   /* Purpose: Wrapper for nc_inq_natts() */
00468   int rcd;
00469   rcd=nc_inq_natts(nc_id,att_glb_nbr);
00470   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_natts");
00471   return rcd;
00472 }/* end nco_inq_natts */

int nco_inq_ndims const int  nc_id,
int *const   dmn_nbr_fl
 

Definition at line 445 of file nco_netcdf.c.

References nc_inq_ndims, NC_NOERR, and nco_err_exit().

00446 {
00447   /* Purpose: Wrapper for nc_inq_ndims() */
00448   int rcd;
00449   rcd=nc_inq_ndims(nc_id,dmn_nbr_fl);
00450   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_ndims");
00451   return rcd;
00452 }/* end nco_inq_ndims */

int nco_inq_nvars const int  nc_id,
int *const   var_nbr_fl
 

Definition at line 455 of file nco_netcdf.c.

References nc_inq_nvars, NC_NOERR, and nco_err_exit().

00456 {
00457   /* Purpose: Wrapper for nc_inq_nvars() */
00458   int rcd;
00459   rcd=nc_inq_nvars(nc_id,var_nbr_fl);
00460   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_nvars");
00461   return rcd;
00462 }/* end nco_inq_nvars */

int nco_inq_unlimdim const int  nc_id,
int *const   rec_dmn_id
 

Definition at line 475 of file nco_netcdf.c.

References nc_inq_unlimdim, NC_NOERR, and nco_err_exit().

00476 {
00477   /* Purpose: Wrapper for nc_inq_unlimdim() */
00478   int rcd;
00479   rcd=nc_inq_unlimdim(nc_id,rec_dmn_id);
00480   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_unlimdim");
00481   return rcd;
00482 }/* end nco_inq_unlimdim */

int nco_inq_var const int  nc_id,
const int  var_id,
char *const   var_nm,
nc_type *const   var_typ,
int *const   dmn_nbr,
int *const   dmn_id,
int *const   nbr_att
 

Definition at line 586 of file nco_netcdf.c.

References nc_inq_var, NC_NOERR, and nco_err_exit().

00587 {
00588   /* Purpose: Wrapper for nco_inq_var() */
00589   int rcd;
00590   rcd=nc_inq_var(nc_id,var_id,var_nm,var_typ,dmn_nbr,dmn_id,nbr_att);
00591   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_var");
00592   return rcd;
00593 } /* end nco_inq_var */

int nco_inq_vardimid const int  nc_id,
const int  var_id,
int *const   dmn_id
 

Definition at line 649 of file nco_netcdf.c.

References nc_inq_vardimid, NC_NOERR, and nco_err_exit().

00650 {
00651   /* Purpose: Wrapper for nc_inq_vardimid() */
00652   int rcd;
00653   rcd=nc_inq_vardimid(nc_id,var_id,dmn_id);
00654   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_vardimid");
00655   return rcd;
00656 } /* end nco_inq_vardimid */

int nco_inq_varid const int  nc_id,
const char *const   var_nm,
int *const   var_id
 

Definition at line 596 of file nco_netcdf.c.

References NC_ENOTVAR, nc_inq_varid, NC_NOERR, and nco_err_exit().

00597 {
00598   /* Purpose: Wrapper for nc_inq_varid() */
00599   const char fnc_nm[]="nco_inq_varid()";
00600   int rcd;
00601   rcd=nc_inq_varid(nc_id,var_nm,var_id);
00602   if(rcd == NC_ENOTVAR) (void)fprintf(stdout,"ERROR: %s reports requested variable \"%s\" is not in input file\n",fnc_nm,var_nm);
00603   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
00604   return rcd;
00605 } /* end nco_inq_varid */

int nco_inq_varid_flg const int  nc_id,
const char *const   var_nm,
int *const   var_id
 

Definition at line 608 of file nco_netcdf.c.

References NC_ENOTVAR, nc_inq_varid, NC_NOERR, and nco_err_exit().

Referenced by arm_inq(), arm_time_mk(), main(), ncap_att_init(), ncap_var_init(), ncap_var_write(), nco_arm_time_install(), nco_att_lst_mk(), nco_cnv_ccm_ccsm_cf_date(), nco_cpy_var_dfn(), nco_cpy_var_dfn_lmt(), nco_dmn_fll(), nco_msa_prn_var_val(), nco_nm_id_lst_crd_make(), nco_prn_var_dfn(), nco_prn_var_val_lmt(), nco_var_dfn(), nco_var_lst_add_crd(), nco_var_lst_ass_crd_add(), nco_var_lst_crd_xcl(), and nco_var_lst_mk_old().

00609 {
00610   /* Purpose: Wrapper for nc_inq_varid_flg() which does not require success */
00611   int rcd;
00612   rcd=nc_inq_varid(nc_id,var_nm,var_id);
00613   if(rcd == NC_ENOTVAR) return rcd;
00614   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_varid_flg");
00615   return rcd;
00616 } /* end nco_inq_varid */

int nco_inq_varname const int  nc_id,
const int  var_id,
char *const   var_nm
 

Definition at line 619 of file nco_netcdf.c.

References nc_inq_varname, NC_NOERR, and nco_err_exit().

00620 {
00621   /* Purpose: Wrapper for nc_inq_varname() */
00622   int rcd;
00623   rcd=nc_inq_varname(nc_id,var_id,var_nm);
00624   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_varname");
00625   return rcd;
00626 } /* end nco_inq_varname */

int nco_inq_varnatts const int  nc_id,
const int  var_id,
int *const   nbr_att
 

Definition at line 659 of file nco_netcdf.c.

References nc_inq_varnatts, NC_NOERR, and nco_err_exit().

00660 {
00661   /* Purpose: Wrapper for nc_inq_varnatts() */
00662   int rcd;
00663   rcd=nc_inq_varnatts(nc_id,var_id,nbr_att);
00664   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_varnatts");
00665   return rcd;
00666 } /* end nco_inq_varnatts */

int nco_inq_varndims const int  nc_id,
const int  var_id,
int *const   dmn_nbr
 

Definition at line 639 of file nco_netcdf.c.

References nc_inq_varndims, NC_NOERR, and nco_err_exit().

00640 {
00641   /* Purpose: Wrapper for nc_inq_varndims() */
00642   int rcd;
00643   rcd=nc_inq_varndims(nc_id,var_id,dmn_nbr);
00644   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_varndims");
00645   return rcd;
00646 } /* end nco_inq_varndims */

int nco_inq_vartype const int  nc_id,
const int  var_id,
nc_type *const   var_typ
 

Definition at line 629 of file nco_netcdf.c.

References nc_inq_vartype, NC_NOERR, and nco_err_exit().

00630 {
00631   /* Purpose: Wrapper for nc_inq_vartype() */
00632   int rcd;
00633   rcd=nc_inq_vartype(nc_id,var_id,var_typ);
00634   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_inq_vartype");
00635   return rcd;
00636 } /* end nco_inq_vartype */

int nco_open const char *const   fl_nm,
const int  mode,
int *const   nc_id
 

Definition at line 315 of file nco_netcdf.c.

References NC_NOERR, nc_open, and nco_err_exit().

00316 {
00317   /* Purpose: Wrapper for nc_open() */
00318   const char fnc_nm[]="nco_open()";
00319   int rcd;
00320   rcd=nc_open(fl_nm,mode,nc_id);
00321   if(rcd != NC_NOERR) nco_err_exit(rcd,fnc_nm);
00322   return rcd;
00323 } /* end nco_open */

int nco_put_att const int  nc_id,
const int  var_id,
const char *const   att_nm,
const nc_type  att_typ,
const long  att_len,
const void *const   vp
 

Definition at line 959 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_NOERR, nc_put_att_double, nc_put_att_float, nc_put_att_short, NC_SHORT, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_PUT_ATT_BYTE, NCO_PUT_ATT_CHAR, NCO_PUT_ATT_INT, NCO_PUT_ATT_INT64, NCO_PUT_ATT_UINT, NCO_PUT_ATT_UINT64, and NCO_PUT_ATT_USHORT.

00960 {
00961   /* Purpose: Wrapper for nc_put_att_*() */
00962   int rcd=NC_NOERR;
00963   switch(att_typ){
00964   case NC_FLOAT: rcd=nc_put_att_float(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const float *)vp); break;
00965   case NC_DOUBLE: rcd=nc_put_att_double(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const double *)vp); break;
00966   case NC_INT: rcd=NCO_PUT_ATT_INT(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_int *)vp); break;
00967   case NC_SHORT: rcd=nc_put_att_short(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const short *)vp); break;
00968   case NC_CHAR: rcd=NCO_PUT_ATT_CHAR(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_char *)vp); break;
00969   case NC_BYTE: rcd=NCO_PUT_ATT_BYTE(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_byte *)vp); break;
00970 #ifdef ENABLE_NETCDF4
00971     /* 20051119: netcdf4 library did not support these until alpha10, still does not support nco_put/get_att_ubyte() */
00972     /*  case NC_UBYTE: rcd=NCO_PUT_ATT_UBYTE(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_ubyte *)vp); break;*/
00973   case NC_USHORT: rcd=NCO_PUT_ATT_USHORT(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_ushort *)vp); break;
00974   case NC_UINT: rcd=NCO_PUT_ATT_UINT(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_uint *)vp); break;
00975   case NC_INT64: rcd=NCO_PUT_ATT_INT64(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_int64 *)vp); break;
00976   case NC_UINT64: rcd=NCO_PUT_ATT_UINT64(nc_id,var_id,att_nm,att_typ,(size_t)att_len,(const nco_uint64 *)vp); break;
00977 #endif /* !ENABLE_NETCDF4 */
00978   default: nco_dfl_case_nc_type_err(); break;
00979   } /* end switch */
00980   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_att");
00981   return rcd;
00982 } /* end nco_put_att */

int nco_put_var1 const int  nc_id,
const int  var_id,
const long *const   srt,
const void *const   vp,
const nc_type  type
 

Definition at line 717 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_NOERR, nc_put_var1_double, nc_put_var1_float, nc_put_var1_short, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_PUT_VAR1_BYTE, NCO_PUT_VAR1_CHAR, NCO_PUT_VAR1_INT, NCO_PUT_VAR1_INT64, NCO_PUT_VAR1_UBYTE, NCO_PUT_VAR1_UINT, NCO_PUT_VAR1_UINT64, and NCO_PUT_VAR1_USHORT.

Referenced by main(), ncap_var_write(), nco_aed_prc(), nco_cpy_var_val(), nco_cpy_var_val_lmt(), nco_cpy_var_val_mlt_lmt(), and nco_var_val_cpy().

00718 {
00719   /* Purpose: Wrapper for nc_put_var1_*() */
00720   int rcd=NC_NOERR;
00721   switch(type){
00722   case NC_FLOAT: rcd=nc_put_var1_float(nc_id,var_id,(const size_t *)srt,(const float *)vp); break;
00723   case NC_DOUBLE: rcd=nc_put_var1_double(nc_id,var_id,(const size_t *)srt,(const double *)vp); break;
00724   case NC_INT: rcd=NCO_PUT_VAR1_INT(nc_id,var_id,(const size_t *)srt,(const nco_int *)vp); break;
00725   case NC_SHORT: rcd=nc_put_var1_short(nc_id,var_id,(const size_t *)srt,(const short *)vp); break;
00726   case NC_CHAR: rcd=NCO_PUT_VAR1_CHAR(nc_id,var_id,(const size_t *)srt,(const nco_char *)vp); break;
00727   case NC_BYTE: rcd=NCO_PUT_VAR1_BYTE(nc_id,var_id,(const size_t *)srt,(const nco_byte *)vp); break;
00728 #ifdef ENABLE_NETCDF4
00729   case NC_UBYTE: rcd=NCO_PUT_VAR1_UBYTE(nc_id,var_id,(const size_t *)srt,(const nco_ubyte *)vp); break;
00730   case NC_USHORT: rcd=NCO_PUT_VAR1_USHORT(nc_id,var_id,(const size_t *)srt,(const nco_ushort *)vp); break;
00731   case NC_UINT: rcd=NCO_PUT_VAR1_UINT(nc_id,var_id,(const size_t *)srt,(const nco_uint *)vp); break;
00732   case NC_INT64: rcd=NCO_PUT_VAR1_INT64(nc_id,var_id,(const size_t *)srt,(const nco_int64 *)vp); break;
00733   case NC_UINT64: rcd=NCO_PUT_VAR1_UINT64(nc_id,var_id,(const size_t *)srt,(const nco_uint64 *)vp); break;
00734 #endif /* !ENABLE_NETCDF4 */
00735   default: nco_dfl_case_nc_type_err(); break;
00736   } /* end switch */
00737   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_var1");
00738   return rcd;
00739 } /* end nco_put_var1 */

int nco_put_vara const int  nc_id,
const int  var_id,
const long *const   srt,
const long *const   cnt,
const void *const   vp,
const nc_type  type
 

Definition at line 767 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_NOERR, nc_put_vara_double, nc_put_vara_float, nc_put_vara_short, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_PUT_VARA_BYTE, NCO_PUT_VARA_CHAR, NCO_PUT_VARA_INT, NCO_PUT_VARA_INT64, NCO_PUT_VARA_UBYTE, NCO_PUT_VARA_UINT, NCO_PUT_VARA_UINT64, and NCO_PUT_VARA_USHORT.

00768 {
00769   /* Purpose: Wrapper for nc_put_vara_*() */
00770   int rcd=NC_NOERR;
00771   switch(type){
00772   case NC_FLOAT: rcd=nc_put_vara_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const float *)vp); break;
00773   case NC_DOUBLE: rcd=nc_put_vara_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const double *)vp); break;
00774   case NC_INT: rcd=NCO_PUT_VARA_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_int *)vp); break;
00775   case NC_SHORT: rcd=nc_put_vara_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const short *)vp); break;
00776   case NC_CHAR: rcd=NCO_PUT_VARA_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_char *)vp); break;
00777   case NC_BYTE: rcd=NCO_PUT_VARA_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_byte *)vp); break;
00778 #ifdef ENABLE_NETCDF4
00779   case NC_UBYTE: rcd=NCO_PUT_VARA_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_ubyte *)vp); break;
00780   case NC_USHORT: rcd=NCO_PUT_VARA_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_ushort *)vp); break;
00781   case NC_UINT: rcd=NCO_PUT_VARA_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_uint *)vp); break;
00782   case NC_INT64: rcd=NCO_PUT_VARA_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_int64 *)vp); break;
00783   case NC_UINT64: rcd=NCO_PUT_VARA_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const nco_uint64 *)vp); break;
00784 #endif /* !ENABLE_NETCDF4 */
00785   default: nco_dfl_case_nc_type_err(); break;
00786   } /* end switch */
00787   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_vara");
00788   return rcd;
00789 } /* end nco_put_vara */

int nco_put_varm const int  nc_id,
const int  var_id,
const long *const   srt,
const long *const   cnt,
const long *  srd,
const long *const   map,
const void *const   vp,
const nc_type  type
 

Definition at line 818 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_NOERR, nc_put_varm_double, nc_put_varm_float, nc_put_varm_short, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), nco_err_exit(), NCO_PUT_VARM_BYTE, NCO_PUT_VARM_CHAR, NCO_PUT_VARM_INT, NCO_PUT_VARM_INT64, NCO_PUT_VARM_UBYTE, NCO_PUT_VARM_UINT, NCO_PUT_VARM_UINT64, and NCO_PUT_VARM_USHORT.

00819 {
00820   /* Purpose: Wrapper for nc_put_varm_*() */
00821   int rcd=NC_NOERR;
00822   switch(type){
00823   case NC_FLOAT: rcd=nc_put_varm_float(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const float *)vp); break;
00824   case NC_DOUBLE: rcd=nc_put_varm_double(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const double *)vp); break;
00825   case NC_INT: rcd=NCO_PUT_VARM_INT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_int *)vp); break;
00826   case NC_SHORT: rcd=nc_put_varm_short(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const short *)vp); break;
00827   case NC_CHAR: rcd=NCO_PUT_VARM_CHAR(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_char *)vp); break;
00828   case NC_BYTE: rcd=NCO_PUT_VARM_BYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_byte *)vp); break;
00829 #ifdef ENABLE_NETCDF4
00830   case NC_UBYTE: rcd=NCO_PUT_VARM_UBYTE(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_ubyte *)vp); break;
00831   case NC_USHORT: rcd=NCO_PUT_VARM_USHORT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_ushort *)vp); break;
00832   case NC_UINT: rcd=NCO_PUT_VARM_UINT(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_uint *)vp); break;
00833   case NC_INT64: rcd=NCO_PUT_VARM_INT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_int64 *)vp); break;
00834   case NC_UINT64: rcd=NCO_PUT_VARM_UINT64(nc_id,var_id,(const size_t *)srt,(const size_t *)cnt,(const ptrdiff_t *)srd,(const ptrdiff_t *)map,(const nco_uint64 *)vp); break;
00835 #endif /* !ENABLE_NETCDF4 */
00836   default: nco_dfl_case_nc_type_err(); break;
00837   } /* end switch */
00838   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_put_varm");
00839   return rcd;
00840 } /* end nco_put_varm */

int nco_redef const int  nc_id  ) 
 

Definition at line 357 of file nco_netcdf.c.

References NC_NOERR, nc_redef, and nco_err_exit().

00358 {
00359   /* Purpose: Wrapper for nc_redef() */
00360   int rcd;
00361   rcd=nc_redef(nc_id);
00362   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_redef");
00363   return rcd;
00364 } /* end nco_redef */

int nco_rename_att const int  nc_id,
const int  var_id,
const char *const   att_nm,
const char *const   att_new_nm
 

Definition at line 939 of file nco_netcdf.c.

References NC_NOERR, nc_rename_att, and nco_err_exit().

Referenced by main().

00940 {
00941   /* Purpose: Wrapper for nc_rename_att() */
00942   int rcd;
00943   rcd=nc_rename_att(nc_id,var_id,att_nm,att_new_nm);
00944   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_rename_att");
00945   return rcd;
00946 }  /* end nco_rename_att */

int nco_rename_dim const int  nc_id,
const int  dmn_id,
const char *const   dmn_nm
 

Definition at line 564 of file nco_netcdf.c.

References NC_NOERR, nc_rename_dim, and nco_err_exit().

Referenced by main().

00565 {
00566   /* Purpose: Wrapper for nc_rename_dim() */
00567   int rcd;
00568   rcd=nc_rename_dim(nc_id,dmn_id,dmn_nm);
00569   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_rename_dim");
00570   return rcd;
00571 }  /* end nco_inq_rename_dim */

int nco_rename_var const int  nc_id,
const int  var_id,
const char *const   var_nm
 

Definition at line 669 of file nco_netcdf.c.

References NC_NOERR, nc_rename_var, and nco_err_exit().

Referenced by main().

00670 {
00671   /* Purpose: Wrapper for nc_rename_var() */
00672   int rcd;
00673   rcd=nc_rename_var(nc_id,var_id,var_nm);
00674   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_rename_var");
00675   return rcd;
00676 } /* end nco_rename_var */

int nco_set_fill const int  nc_id,
const int  fill_mode,
int *const   old_mode
 

Definition at line 367 of file nco_netcdf.c.

References NC_NOERR, nc_set_fill, and nco_err_exit().

00368 {
00369   /* Purpose: Wrapper for nc_set_fill() */
00370   int rcd;
00371   rcd=nc_set_fill(nc_id,fill_mode,old_mode);
00372   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_set_fill");
00373   return rcd;
00374 } /* end nco_set_fill */

int nco_sync const int  nc_id  ) 
 

Definition at line 404 of file nco_netcdf.c.

References NC_NOERR, nc_sync, and nco_err_exit().

Referenced by nco_arm_time_install().

00405 {
00406   /* Purpose: Wrapper for nc_sync() */
00407   int rcd;
00408   rcd=nc_sync(nc_id);
00409   if(rcd != NC_NOERR) nco_err_exit(rcd,"nco_sync");
00410   return rcd;
00411 } /* end nco_sync */

size_t nco_typ_lng const nc_type  nco_typ  ) 
 

Definition at line 86 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, and nco_dfl_case_nc_type_err().

00087 {
00088   /* Purpose: Return native size of specified netCDF type
00089      Routine is used to determine memory required to store variables in RAM
00090      This is only routine in nco_netcdf which needs NCO opaque type definitions
00091      nco_byte, nco_char, and nco_int defined in nco_typ.h */
00092   switch(nco_typ){
00093   case NC_FLOAT:
00094     return sizeof(float);
00095   case NC_DOUBLE:
00096     return sizeof(double);
00097   case NC_INT:
00098     return sizeof(nco_int);
00099   case NC_SHORT:
00100     return sizeof(short);
00101   case NC_CHAR:
00102     return sizeof(nco_char);
00103   case NC_BYTE:
00104     return sizeof(nco_byte);
00105   case NC_UBYTE:
00106     return sizeof(nco_ubyte);
00107   case NC_USHORT:
00108     return sizeof(nco_ushort);
00109   case NC_UINT:
00110     return sizeof(nco_uint);
00111   case NC_INT64:
00112     return sizeof(nco_int64);
00113   case NC_UINT64:
00114     return sizeof(nco_uint64);
00115   default: nco_dfl_case_nc_type_err(); break;
00116   } /* end switch */
00117 
00118   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
00119   return 0;
00120 } /* end nco_typ_lng() */

const char* nco_typ_sng const nc_type  type  ) 
 

Definition at line 124 of file nco_netcdf.c.

References NC_BYTE, NC_CHAR, NC_DOUBLE, NC_FLOAT, NC_INT, NC_INT64, NC_SHORT, NC_UBYTE, NC_UINT, NC_UINT64, NC_USHORT, nco_dfl_case_nc_type_err(), and type.

00125 {
00126   switch(type){
00127   case NC_FLOAT:
00128     return "NC_FLOAT";
00129   case NC_DOUBLE:
00130     return "NC_DOUBLE";
00131   case NC_INT:
00132     return "NC_INT";
00133   case NC_SHORT:
00134     return "NC_SHORT";
00135   case NC_CHAR:
00136     return "NC_CHAR";
00137   case NC_BYTE:
00138     return "NC_BYTE";
00139   case NC_UBYTE:
00140     return "NC_UBYTE";
00141   case NC_USHORT:
00142     return "NC_USHORT";
00143   case NC_UINT:
00144     return "NC_UINT";
00145   case NC_INT64:
00146     return "NC_INT64";
00147   case NC_UINT64:
00148     return "NC_UINT64";
00149   default: nco_dfl_case_nc_type_err(); break;
00150   } /* end switch */
00151 
00152   /* Some compilers, e.g., SGI cc, need return statement to end non-void functions */
00153   return (char *)NULL;
00154 } /* end nco_typ_sng() */


Generated on Thu Mar 16 18:15:59 2006 for nco by  doxygen 1.4.4