Another concatenation problem : re-stacking the atmosphere

From: John Helly <hellyj_at_nyahnyahspammersnyahnyah>
Date: Fri Dec 09 2011 - 23:10:51 MST

Hi.

I've been looking around various archives for a solution and the ones I've found using NCO (ncrcat, ncecat) don't seem to suit this problem so I'm thinking I'm going to need an NCL solution.

Here's the problem.

I have a time series of netCDF files but each netCDF file represents only 1/14th of the atmosphere vertically over the fixed horizontal domain. So, for any given time t I need to re-stack 14 netCDF files into a single file so I can visualize it as a 3D-volume. This is further complicated by the fact that each of the 14 files is 1.8GB.

Using the NCO approach, I tried switching the record variable and then using ncrcat. That succeeds in putting the right dimensional quantity in the record variable but I can't get it to switch back to being a fixed variable using ncpdq. I don't think ncpdq can do that based on the error message.

So, I'm hoping NCL can do this. Each netCDF file has the following attributes:

ncdump -h GATE_IDEAL_S_00450_001_to_014.nc
netcdf GATE_IDEAL_S_00450_001_to_014 {
dimensions:
        x = 2048 ;
        y = 2048 ;
        z = 14 ;
        time = UNLIMITED ; // (1 currently)
variables:
        float x(x) ;
                x:units = "m" ;
        float y(y) ;
                y:units = "m" ;
        float z(z) ;
                z:units = "m" ;
                z:long_name = "height" ;
        float time(time) ;
                time:units = "d" ;
                time:long_name = "time" ;
        float p(z) ;
                p:units = "mb" ;
                p:long_name = "pressure" ;
        float U(time, z, y, x) ;
                U:long_name = "X Wind Component " ;
                U:units = "m/s " ;
        float V(time, z, y, x) ;
                V:long_name = "Y Wind Component " ;
                V:units = "m/s " ;
        float W(time, z, y, x) ;
                W:long_name = "Z Wind Component " ;
                W:units = "m/s " ;
        float PP(time, z, y, x) ;
                PP:long_name = "Pressure Perturbation " ;
                PP:units = "Pa " ;
        float TABS(time, z, y, x) ;
                TABS:long_name = "Absolute Temperature " ;
                TABS:units = "K " ;
        float QV(time, z, y, x) ;
                QV:long_name = "Water Vapor " ;
                QV:units = "g/kg " ;
        float QN(time, z, y, x) ;
                QN:long_name = "Non-precipitating Condensate (Water+Ice) " ;
                QN:units = "g/kg " ;
        float QP(time, z, y, x) ;
                QP:long_name = "Precipitating Water (Rain+Snow) " ;
                QP:units = "g/kg " ;
}

So, z should be incremented for each layer by 14 levels (except the last file which is something less but fixed, just don't have one available at the moment to check).

Can you suggest an approach to doing this with NCL or something about NCO I'm overlooking? Thanks.

Cheers.
--------------
John Helly, University of California, San Diego / San Diego Supercomputer Center / Scripps Institution of Oceanography / 760 840 8660 mobile / stonesteps (Skype) / stonesteps7 (iChat) / http://www.sdsc.edu/~hellyj

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Dec 9 23:11:08 2011

This archive was generated by hypermail 2.1.8 : Fri Dec 16 2011 - 10:27:49 MST