Skip to content

Guide to Supported ExtData Input Files

Ben Auer edited this page Feb 16, 2024 · 13 revisions

Introduction

This will be a guide on what ExtData expects to have in its files for inputs. Note that since the History component uses the same IO layer, this is also describes what sort of files you will get from History.

Horizontal Dimensions and Metadata

The the horizontal dimensions and any associated metadata variable depend on the grid type. There are generally 3 grid types we currently support.

Lat-lon

The file must have 2 dimensions, name lon and lat and two coordinate variables of the same name.

dimensions:
        lon = 180 ;
        lat = 91 ;
variables:
        double lon(lon) ;
                lon:long_name = "longitude" ;
                lon:units = "degrees_east" ;
        double lat(lat) ;
                lat:long_name = "latitude" ;
                lat:units = "degrees_north" ;

Cubed-sphere

        Xdim = 180 ;
        Ydim = 180 ;
        nf = 6 ;
        ncontact = 4 ;
        orientationStrLen = 5 ;
variables:
        int nf(nf) ;
                nf:long_name = "cubed-sphere face" ;
                nf:axis = "e" ;
                nf:grads_dim = "e" ;
        int ncontact(ncontact) ;
                ncontact:long_name = "number of contact points" ;
        char cubed_sphere ;
                cubed_sphere:grid_mapping_name = "gnomonic cubed-sphere" ;
                cubed_sphere:file_format_version = "2.90" ;
                cubed_sphere:additional_vars = "contacts,orientation,anchor" ;
                cubed_sphere:gridspec_file = "C180_gridspec.nc4" ;
        double Xdim(Xdim) ;
                Xdim:long_name = "Fake Longitude for GrADS Compatibility" ;
                Xdim:units = "degrees_east" ;
        double Ydim(Ydim) ;
                Ydim:long_name = "Fake Latitude for GrADS Compatibility" ;
                Ydim:units = "degrees_north" ;
        double lons(nf, Ydim, Xdim) ;
                lons:long_name = "longitude" ;
                lons:units = "degrees_east" ;
        double lats(nf, Ydim, Xdim) ;
                lats:long_name = "latitude" ;
                lats:units = "degrees_north" ;
        int contacts(nf, ncontact) ;
                contacts:long_name = "adjacent face starting from left side going clockwise" ;
        char orientation(nf, ncontact, orientationStrLen) ;
                orientation:long_name = "orientation of boundary" ;
        int anchor(nf, ncontact, ncontact) ;
                anchor:long_name = "anchor point"

Tripolar

dimensions:
        XCdim = 73 ;
        Xdim = 72 ;
        YCdim = 37 ;
        Ydim = 36 ;
variables:
        double Xdim(Xdim) ;
                Xdim:long_name = "Fake Longitude for GrADS Compatibility" ;
                Xdim:units = "degrees_east" ;
        double Ydim(Ydim) ;
                Ydim:long_name = "Fake Latitude for GrADS Compatibility" ;
                Ydim:units = "degrees_north" ;
        double lons(Ydim, Xdim) ;
                lons:long_name = "longitude" ;
                lons:units = "degrees_east" ;
        double lats(Ydim, Xdim) ;
                lats:long_name = "latitude" ;
                lats:units = "degrees_north" ;
        double corner_lons(YCdim, XCdim) ;
                corner_lons:long_name = "longitude" ;
                corner_lons:units = "degrees_east" ;
        double corner_lats(YCdim, XCdim) ;
                corner_lats:long_name = "latitude" ;
                corner_lats:units = "degrees_north" ;
// global attributes:
                :grid_type = "Tripolar" ;

Vertical Dimension

Input files are allow to have one dimension not associated with the horizontal dimensions. It must be named 'lev no matter what. And this needs to be the actual model level your application is on or at least those levels but flipped, just remember to set the positive attribute.

GEOS model level example:

dimensions:
        lev = 72 ;
variables:
        double lev(lev) ;
                lev:long_name = "vertical level" ;
                lev:units = "layer" ;
                lev:positive = "down" ;
                lev:coordinate = "eta" ;
                lev:standard_name = "model_layers" ;

In this case the actual value of the lev variable are just the level index from 1 to the size of lev. The import attribute on that is the positive. This is saying the top of the atmosphere is the first index.

Fixed pressure level example

Files that have fixed pressure levels would look like this, not that ExtData would know what to do with this.

dimensions:
        lev = 48 ;
variables:
        double lev(lev) ;
                lev:coordinate = "PLE" ;
                lev:long_name = "vertical level" ;
                lev:positive = "down" ;
                lev:standard_name = "PLE_level" ;
                lev:units = "hPa" ;
                lev:_FillValue = 1.e+15f ;

data:

 lev = 1000, 975, 950, 925, 900, 875, 850, 825, 800, 775, 750, 725, 700, 650,
    600, 550, 500, 450, 400, 350, 300, 250, 200, 150, 100, 70, 50, 40, 30,
    20, 10, 7, 5, 4, 3, 2, 1, 0.699999988079071, 0.5, 0.400000005960464,
    0.300000011920929, 0.200000002980232, 0.100000001490116,
    0.0700000002980232, 0.0500000007450581, 0.0399999991059303,
    0.0299999993294477, 0.0199999995529652 ;

Time Dimension

Time can be a fixed or unlimited dimension, the time variable should follow the usual CF convention something like this for the units. As far as the type, double, float, or integer are supported. The example below is a float.

dimensions:
        time = UNLIMITED ; // (1 currently)
variables:
        float time(time) ;
                time:long_name = "time" ;
                time:units = "minutes since 2015-04-15 00:00:00" ;

Rules for Variables

Each variable, that is something that is not part of the horizontal grid or vertical level metadata and variables specific for those must conform to the following

  • Every variable must depend on the dimensions in this order: horizontal dimensions, vertical dimension (optional), time
  • Note that only the vertical dimension is optional. All variables must depend on any dimensions associated with the horizontal and time. Time is not optional, if your dataset doesn't depend on time, just add it anyway. If not, ExtData is not reading it.
  • Each variable must have a units attribute and a long_name attribute.
Clone this wiki locally