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

« back to all changes in this revision

Viewing changes to src/Ymonpctl.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:
25
25
#include <stdio.h>
26
26
#include <math.h>
27
27
 
28
 
#include "cdi.h"
 
28
#include <cdi.h>
29
29
#include "cdo.h"
30
30
#include "cdo_int.h"
31
31
#include "pstream.h"
36
36
 
37
37
void *Ymonpctl(void *argument)
38
38
{
39
 
  static char func[] = "Ymonpctl";
 
39
  static const char *func = "Ymonpctl";
40
40
  int gridsize;
41
41
  int varID;
42
42
  int recID;
58
58
  double missval;
59
59
  field_t **vars1[NMONTH];
60
60
  field_t field;
61
 
  int pn;
 
61
  double pn;
62
62
  HISTOGRAM_SET *hsets[NMONTH];
63
63
 
64
64
  cdoInitialize(argument);
65
65
  cdoOperatorAdd("ymonpctl", func_pctl, 0, NULL);
66
66
 
67
67
  operatorInputArg("percentile number");
68
 
  pn = atoi(operatorArgv()[0]);
 
68
  pn = atof(operatorArgv()[0]);
69
69
      
70
 
  if ( pn < 1 || pn > 99 )
71
 
    cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
 
70
  if ( !(pn > 0 && pn < 100) )
 
71
    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
72
72
 
73
73
  for ( month = 0; month < NMONTH; month++ )
74
74
    {
89
89
  vlistID3 = streamInqVlist(streamID3);
90
90
  vlistID4 = vlistDuplicate(vlistID1);
91
91
 
92
 
  vlistCompare(vlistID1, vlistID2, func_hrd);
93
 
  vlistCompare(vlistID1, vlistID3, func_hrd);
 
92
  vlistCompare(vlistID1, vlistID2, CMP_HRD);
 
93
  vlistCompare(vlistID1, vlistID3, CMP_HRD);
94
94
 
95
95
  taxisID1 = vlistInqTaxis(vlistID1);
96
96
  taxisID2 = vlistInqTaxis(vlistID2);