Menu

weighted vertical integration

2016-07-07
2016-07-11
  • Irina Mahlstein

    Irina Mahlstein - 2016-07-07

    Hi
    I would like to perform a weighted vertical integration. The heather of my file looks as following:
    dimensions:
    level = 10 ;
    latitude = 181 ;
    longitude = 360 ;
    time = 1 ;
    variables:
    double level(level) ;
    level:axis = "Z" ;
    level:units = "millibars" ;
    level:long_name = "pressure_level" ;
    float pw(level) ;
    pw:_FillValue = 1.e+32f ;
    pw:long_name = "pressure level weights" ;
    float latitude(latitude) ;
    latitude:units = "degrees_north" ;
    latitude:long_name = "latitude" ;
    float longitude(longitude) ;
    longitude:units = "degrees_east" ;
    longitude:long_name = "longitude" ;
    float q(time, level, latitude, longitude) ;
    q:_FillValue = 9.96921e+36f ;
    q:missing_value = 9.96921e+36f ;
    q:units = "kg kg**-1" ;
    q:long_name = "Specific humidity" ;
    q:standard_name = "specific_humidity" ;
    int time(time) ;
    time:units = "hours since 1900-01-01 00:00:0.0" ;
    time:long_name = "time" ;
    time:calendar = "gregorian" ;

       I want to integrate variable 'q' over the level dimension applying the weights 'pw'.
    
       If I do the following:
       ncwa  -N -v q -w pw
       I end up with one number. It seems to loose the lat/long dimensions.
    
       Thanks for your help!
    
     
  • Charlie Zender

    Charlie Zender - 2016-07-07

    By default ncwa averages over all dimensions. Use -a option to restrict the averaging to specified dimensions, i.e., try
    ncwa -N -v q -w pw -a level

     
  • Irina Mahlstein

    Irina Mahlstein - 2016-07-11

    thanks

     

Log in to post a comment.