File: vpointer-ex1.nco

package info (click to toggle)
nco 5.3.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 38,260 kB
  • sloc: ansic: 84,963; cpp: 28,654; sh: 14,071; perl: 5,996; makefile: 2,009; lex: 1,009; python: 127; csh: 40
file content (47 lines) | stat: -rw-r--r-- 920 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47

// Produce a list of all vars in input
// each element of att list  is of type NC_STRING
// nb get_var_in() can take a single argument that can be a var name or regular expression
// lists are  of type NC_STRING and can are in essence ragged arrays

@all=get_vars_in();

*sz=@all.size();
*idx=0;

for(idx=0;idx<sz;idx++)
{
  // remember @var_nm is of type NC_STRING
  @var_nm=@all(idx);
 
  if( *@var_nm.type()==NC_FLOAT)
     *@var_nm=*@var_nm.double();

  else if( *@var_nm.type()==NC_DOUBLE )
     *@var_nm=*@var_nm; 
}

@out=get_vars_out();


print("\n/****************************/\n");
print(@out);
print("\n/****************************/\n");



*sz=@out.size();
*idx=0;

for(idx=0;idx<sz;idx++)
{
  // remember @var_nm is of type NC_STRING
  @var_nm=@out(idx);
 
  if( *@var_nm.type()==NC_DOUBLE && *@var_nm.has_miss() )
  {  print(@var_nm,"about to change miss %s\n");
     *@var_nm.change_miss(-1.0);
  }

}