www.dnw.aero www.onera.fr

Program WDF_READ_VAR

This program is a simple template for reading individual WDF variables without considering any record concept. It prompts only for file name (to give with full extension) and variable to display. Variable names must be entered exactly as they are displayed (case sensitive).

    Variables values are displayed in column on current output. Supported variable types are :
     

    • Short integer
    • Integer
    • Real
    • Double real
    • String


    Array variables may have up to 10 dimensions.

    To generate this program, please perform following action list :
     

    • Generate NetCDF version 3.5 library from Unidata supplying according to specific documentation.
    • Generate WDF_LIB library according to previous chapter
    • Compile and link this program (WDF_READ_VAR) with procedure corresponding to your operating system :

Program WDF_READ_RECORD

This program is a template for WDF reading program using Record concept feature. It supports FULL, SHORT and NULL RecordConcept implementations.
  • It permits access to a subset (a serie, a run or a polar) of the dataset by allowing the user to specify start and end reading positions.
  • It provides access to complete record for which all variables are returned in a generic byte buffer.
  • Then it allows extraction of selected variables within the record and storing in generic arrays according to their data type.
  • Finally, it formats and output values either in a file or on terminal.
  • It may be used as a basis for creating conversion programs between WDF files and user's specific databases.

    Records and variables are selected by their indexes. Record indexes are linked to RecordNames list, variables indexes are related to the record containing the variables, starting at one for the first variable of each record. In this template, variables indexes are linked to long_name attributes list.

    Program prompts for file name (to give with full extension), optional outputs (answer Y or N), Record index (enter 1 to n integers separated by commas to choose, 0 for none, -1 for all) and variable indexes to select (same answer as record's choice).

    To specify starting and ending reading location, enter first character of the range (S[eries] or R[un] or P[olar], a comma, and the value of the range, for example R,388 to specify run 388.

    The program is organised in three steps and loops over step 2 and step 3 as long as user enters valid answers (different from [RETURN] key)

    Step 1 :

    • Opening File
    • Collecting and displaying information
    Step 2 :
    • Set start / end reading position for subset access.
    • Selecting output mode
    • Displaying record names list and associated indexes
    • Selecting records
    • For each selected record, displaying variables names list and associated indexes and variables. If all records are selected, all variables are also automatically selected
    Step 3 :
    • Read selected records in a generic byte buffer.
    • Display selected variable names.
    • Extract select variables in typed generic variables.
    • Format and display variables values
    Variables values are displayed on current output or written in file in Comma Separated Variable (CSV) format (same name as input file with .CSV extension). The location where the user can change the code to interface his own database is indicated in the file.

    Supported variable types are :

    • Short integer
    • Integer
    • Real
    • Double real
    • String
    Array variables may have up to 10 dimensions.

    To generate this program, please perform following action list :

  • Generate NetCDF version 3.5 library from Unidata supplying according to specific documentation
  • Generate WDF_LIB library according to previous chapter
  • Compile and link this program (WDF_READ_VAR) with procedure corresponding to your operating system :