NCL Home> Application examples> Data sets || Data files for some examples

Example pages containing: tips | resources | functions/procedures

NCL: Atmospheric Radiation Measurement (ARM) Program

The Atmospheric Radiation Measurement (ARM) Program was created in 1989 with funding from the U.S. Department of Energy (DOE) to develop several highly instrumented ground stations to study cloud formation processes and their influence on radiative transfer.

Many products are available in netCDF format. Unfortunately, the files do not conform to the COARDS or CF conventions commonly used in climate research. For example, the units associated with the latitude (lat) and longitude (lon) variables are both "degrees" rather than the udunits conforming "degrees_north" and "degrees_east". More problematical is the designation of the variable 'time' which has units relative to midnight of the currrent day (rather than some base date) as UNLIMITED. For example:


     netcdf sgp15swfcldgrid1longN1.c1.20091021.140000 {
     dimensions:
             time = UNLIMITED ; // (35 currently)
             lat = 15 ;
             lon = 17 ;
     variables:
             int base_time ;
                     base_time:string = "21-Oct-2009,14:00:00 GMT" ;
                     base_time:long_name = "Base time in Epoch" ;
                     base_time:units = "seconds since 1970-1-1 0:00:00 0:00" ;
             double time_offset(time) ;
                     time_offset:long_name = "Time offset from base_time" ;
                     time_offset:units = "seconds since 2009-10-21 14:00:00 0:00" ;
             double time(time) ;
                     time:long_name = "Time offset from midnight" ;
                     time:units = "seconds since 2009-10-21 00:00:00 0:00" ;
             float cloudfraction(time, lat, lon) ;
     [SNIP]

Typically, climate involves statistics over some time interval. It is common practice to span many files to create (say) time series, climatologies or, more sophisticated diagnostics. Being able to select data for specific time periods can be essential.

NCL could do this by using addfiles and then, explicitly creating the appropriate time variable via cd_calendar and cd_inv_calendar . A more efficient approach would be to use the netCDF Operators (NCO). The ncrcat operator has been programmed to recognize ARM files. The ncrcat operator will recalculate the 'time_offset' variable to be relative to the 'base_time' in the first file to produce a monotonically increasing 'time_offset' value.

If ARM.1997-2008.nc is the file created by ncrcat, then in NCL:


    f     = addfile ("ARM.1997-2008.nc", "r") ; created by ncrcat
    x     = f->cloudfraction                 ; (time, lat, lon)
    xqc   = f->qc_cloudfraction              ; packed integer; 0 means good 
    timeo = f->time_offset                   ; Time offset from base_time {ncrcat]

    x&time   = timeo                        ; overwrite original 'time' 
    xqc&time = timeo                        ; with time_offset variable 

arm_1.ncl: One sample file from the "sfccldgrid" suite of files is used to create time and spatial averages. The stat_dispersion performs exploratory statistical analysis on the "cloudfrac" variable. The SGP prefix to the file means "Southern Great Plains".
arm_2.ncl: The following ncrcat commad created the ARM_SGP.2005-2009.cdf file:

ncrcat -h sgp15swfcldgrid1longN1.c1.200[5-9]*cdf ARM.2005-2009.nc

The stat_dispersion performs exploratory statistical analysis on the "cloudfrac" variable. EG:

(0)        ===> Robust Dispersion Statistics: Fractional Sky Cover <===
(0)      [0]            Mean=0.449298
(0)      [1]          StdDev=0.366408
       [SNIP]
(0)      [8]          Median=0.387
       [SNIP]
(0)      [21]      % Missing=23.3586

It shows that 23% of the data values are missing.

The locations are fairly close to each other, at each time average all the locations. Create a time series. Interpolate the temporal values to equally spaced time via linint1_n_Wrap. Smooth and plot the series.