Project

General

Profile

Chaining Operator Help

Added by Matt Thompson about 11 years ago

CDO List,

I was wondering if there is something special I need to do in order to chain more than one operator? For example, I can do this:

(1042) $ cdo infon -selname,T Fortuna.datmo.nc4 | head -10
cdo infon: Started child process "selname,T Fortuna.datmo.nc4 (pipe1.1)".
    -1 :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name
     1 : 1997-06-18 23:45:00       1        1       0 :                  211.95             : T          
     2 : 1997-06-18 23:45:00       2        1       0 :                  212.01             : T          
     3 : 1997-06-18 23:45:00       3        1       0 :                  212.58             : T          
     4 : 1997-06-18 23:45:00       4        1       0 :                  216.42             : T          
     5 : 1997-06-18 23:45:00       5        1       0 :                  221.57             : T          
     6 : 1997-06-18 23:45:00       6        1       0 :                  227.89             : T          
     7 : 1997-06-18 23:45:00       7        1       0 :                  233.61             : T          
     8 : 1997-06-18 23:45:00       8        1       0 :                  238.94             : T          
     9 : 1997-06-18 23:45:00       9        1       0 :                  243.54             : T         
to select one of the variables in a file. So, my thought was, well, if I want to diff two files but just diff, say, T, I could chain them:
(1043) $ cdo -v diffn -selname,T Fortuna.datmo.nc4 -selname,T Ganymed.datmo.nc4
cdo diffn: Started child process "selname,T Fortuna.datmo.nc4 (pipe1.1)".
cdo diffn: Started child process "selname,T Ganymed.datmo.nc4 (pipe1.2)".
name 1 = T
name 1 = T
               Date     Time   Level Gridsize    Miss : S Z  Max_Absdiff Max_Reldiff : Parameter name
     1 : 1997-06-18 23:45:00       1        1       0 : F F       0.0000      0.0000 : T          
Segmentation fault (core dumped)
Huh. So, I can use one stream, but not two. I went back out to the configure log and I saw:
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no

So, my first question is, can I even do what I'm trying to do up there? Am I doing it wrong? Or did I build it incorrectly:

(1061) $ cdo -V
Climate Data Operators version 1.5.9 (http://code.zmaw.de/projects/cdo)
Compiler: mpicc -std=gnu99 -fPIC  -D_POSIX_C_SOURCE=199309L 
 version: Intel(R) C Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 13.1.0.146 Build 20130121
    with: PTHREADS NC4 OPeNDAP SZ Z UDUNITS2
Compiled: by mathomp4 on borg01t199 (x86_64-unknown-linux-gnu) Feb 14 2013 07:29:01
     CDI library version : 1.5.9 of Feb 14 2013 07:28:50
 CGRIBEX library version : 1.5.6 of Dec 17 2012 13:44:05
  netCDF library version : 4.2.1.1 of Feb 14 2013 07:25:19 $
    HDF5 library version : 1.8.9
 SERVICE library version : 1.3.1 of Feb 14 2013 07:28:43
   EXTRA library version : 1.3.1 of Feb 14 2013 07:28:38
     IEG library version : 1.3.1 of Feb 14 2013 07:28:40
    FILE library version : 1.8.1 of Feb 14 2013 07:28:39

Thanks,
Matt Thompson


Replies (1)

RE: Chaining Operator Help - Added by Uwe Schulzweida about 11 years ago

Hi Matt,

I assume that your netCDF4/HDF5 library was not compiled threadsafe, see massage:
https://code.zmaw.de/boards/1/topics/1677#message-1678

Best regards,
Uwe

    (1-1/1)