~javier-lopez/ubuntu/quantal/cdo/sru-1023329

« back to all changes in this revision

Viewing changes to src/Seaspctl.c

  • Committer: Bazaar Package Importer
  • Author(s): Alastair McKinstry
  • Date: 2010-09-22 15:58:09 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100922155809-u1d3vlmlqj02uxjt
Tags: 1.4.6.dfsg.1-1
New upstream release. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
*/
23
23
 
24
24
 
25
 
#include "cdi.h"
 
25
#include <cdi.h>
26
26
#include "cdo.h"
27
27
#include "cdo_int.h"
28
28
#include "pstream.h"
32
32
 
33
33
void *Seaspctl(void *argument)
34
34
{
35
 
  static char func[] = "Seaspctl";
 
35
  static const char *func = "Seaspctl";
36
36
  int gridsize;
37
37
  int vdate1 = 0, vtime1 = 0;
38
38
  int vdate2 = 0, vtime2 = 0;
53
53
  double missval;
54
54
  field_t **vars1 = NULL;
55
55
  field_t field;
56
 
  int pn;
 
56
  double pn;
57
57
  HISTOGRAM_SET *hset = NULL;
58
58
  int season_start;
59
59
 
62
62
  cdoOperatorAdd("seaspctl", func_pctl, 0, NULL);
63
63
 
64
64
  operatorInputArg("percentile number");
65
 
  pn = atoi(operatorArgv()[0]);
 
65
  pn = atof(operatorArgv()[0]);
66
66
      
67
 
  if ( pn < 1 || pn > 99 )
68
 
    cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
 
67
  if ( !(pn > 0 && pn < 100) )
 
68
    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
69
69
 
70
70
  season_start = get_season_start();
71
71
 
81
81
  vlistID3 = streamInqVlist(streamID3);
82
82
  vlistID4 = vlistDuplicate(vlistID1);
83
83
 
84
 
  vlistCompare(vlistID1, vlistID2, func_hrd);
85
 
  vlistCompare(vlistID1, vlistID3, func_hrd);
 
84
  vlistCompare(vlistID1, vlistID2, CMP_HRD);
 
85
  vlistCompare(vlistID1, vlistID3, CMP_HRD);
86
86
 
87
87
  taxisID1 = vlistInqTaxis(vlistID1);
88
88
  taxisID2 = vlistInqTaxis(vlistID2);