Unidata Advanced netCDF Workshop

Slides:



Advertisements
Similar presentations
Introduction to C Programming
Advertisements

Core Java Lecture 4-5. What We Will Cover Today What Are Methods Scope and Life Time of Variables Command Line Arguments Use of static keyword in Java.
Java Script Session1 INTRODUCTION.
PL/SQL.
The Future of NetCDF Russ Rew UCAR Unidata Program Center Acknowledgments: John Caron, Ed Hartnett, NASA’s Earth Science Technology Office, National Science.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
Guide To UNIX Using Linux Third Edition
Lecture 18 Last Lecture Today’s Topic Instruction formats
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 4: The Selection Process in Visual Basic.
CH2 – Using Data. Constant Something which cannot be changed Data Type Format and size of a data item Intrinsic Data Types Pg. 47 – Table 2-1 Basic ones.
CMPS 211 JavaScript Topic 1 JavaScript Syntax. 2Outline Goals and Objectives Goals and Objectives Chapter Headlines Chapter Headlines Introduction Introduction.
CS 403: Programming Languages Fall 2004 Department of Computer Science University of Alabama Joel Jones.
The netCDF-4 data model and format Russ Rew, UCAR Unidata NetCDF Workshop 25 October 2012.
Introduction to PHP A user navigates in her browser to a page that ends with a.php extension The request is sent to a web server, which directs the request.
Agenda Regular Expressions (Appendix A in Text) –Definition / Purpose –Commands that Use Regular Expressions –Using Regular Expressions –Using the Replacement.
Integrating netCDF and OPeNDAP (The DrNO Project) Dr. Dennis Heimbigner Unidata Go-ESSP Workshop Seattle, WA, Sept
Accessing Remote Datasets using the DAP protocol through the netCDF interface. Dr. Dennis Heimbigner Unidata netCDF Workshop August 3-4, 2009.
Advanced Utilities Extending ncgen to support the netCDF-4 Data Model Dr. Dennis Heimbigner Unidata netCDF Workshop August 3-4, 2009.
NetCDF Data Model Issues Russ Rew, UCAR Unidata NetCDF 2010 Workshop
Chapter 3 Syntax, Errors, and Debugging Fundamentals of Java.
Programming Fundamentals. Today’s Lecture The Conditional Operator Logical Operators Structures Enumerations.
CSI 3125, Preliminaries, page 1 Data Type, Variables.
Digital Image Processing Introduction to MATLAB. Background on MATLAB (Definition) MATLAB is a high-performance language for technical computing. The.
Department of Electronic & Electrical Engineering Lecture 3 IO reading and writing variables scanf printf format strings "%d %c %f" Expressions operators.
Utilities for netCDF-4 Dr. Dennis Heimbigner Unidata Advanced netCDF Workshop July 25, 2011.
NetCDF Data Model Details Russ Rew, UCAR Unidata NetCDF 2009 Workshop
 It is a pure oops language and a high level language.  It was developed at sun microsystems by James Gosling.
A FIRST BOOK OF C++ CHAPTER 7 ARRAYS. OBJECTIVES In this chapter, you will learn about: One-Dimensional Arrays Array Initialization Arrays as Arguments.
The purpose of a CPU is to process data Custom written software is created for a user to meet exact purpose Off the shelf software is developed by a software.
Lecture 9 Symbol Table and Attributed Grammars
Lecture 5 array declaration and instantiation array reference
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
CSC 211 Java I for loops and arrays.
DAP+NETCDF Using the netCDF-4 Data Model
JAVA MULTIPLE CHOICE QUESTION.
Types CSCE 314 Spring 2016.
Moving from HDF4 to HDF5/netCDF-4
Type Checking Generalizes the concept of operands and operators to include subprograms and assignments Type checking is the activity of ensuring that the.
Constructing Precedence Table
NetCDF 3.6: What’s New Russ Rew
Arrays: Checkboxes and Textareas
Object Oriented Programming
Objectives Identify the built-in data types in C++
Extending the NetCDF Supported Data Formats using a Dispatch Layer
Other Kinds of Arrays Chapter 11
Other Kinds of Arrays Chapter 11
Introduction to XHTML.
Programmazione I a.a. 2017/2018.
MATLAB: Structures and File I/O
Welcome In The World Of ‘C’.  TEXT BOOK: Programming in ANSI ‘C By: E Balagurusamy. TMH  Reference Books: 1) The ‘C Programming Language By: Kernighan.
Computer Science 210 Computer Organization
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 3 Introduction to Classes, Objects Methods and Strings
7 Arrays.
PHP.
C++ Data Types Data Type
Remote Data Access Update
Variables Title slide variables.
Arrays .
File Input and Output.
Dispatch Layer and the NetCDF Architecture
Java Programming Language
Introducing JavaScript
NCL variable based on a netCDF variable model
Java: Variables, Input and Arrays
Data Types Every variable has a given data type. The most common data types are: String - Text made up of numbers, letters and characters. Integer - Whole.
SPL – PS1 Introduction to C++.
Presentation transcript:

Unidata Advanced netCDF Workshop Utilities for netCDF-4 Dr. Dennis Heimbigner Unidata Advanced netCDF Workshop July 25, 2011

Overview Extending CDL to support netCDF-4 Model netCDF4 in CDL: Types netCDF4 in CDL: Typed Attributes netCDF4 in CDL: Groups Scope Rules Specifying Data Constants Special Attributes NCGEN for netCDF4 NCGEN Command Synopsis Extended Example

Extending CDL to Support netCDF-4 Model ncdump and ncgen both support CDL extended to cover the netCDF-4 model. CDL now has the following new elements: Extended set of atomic types User defined types Typed Attributes Groups Special attributes Extended Example

netCDF4 in CDL: Types Supports the new atomic data types: ubyte, ushort, uint, string, int64, uint64 New section called “types:” for user-defined types int enum enum_t {t=0,f=1,other=2}; opaque(11) opaque_t; compound cmpd_t { int64 f1; enum_t f2;}; int(*) vlen_t;

netCDF4 in CDL: Typed Attributes vlen_t v:attr = {17, 18, 19}; Attribute typing is optional (=> type inferred) Warning! x:attr = “abc”; is inferred to be type char, not string Instead say string x:attr = “abc”; Why? for backward compatibility with ncgen3 Good practice to add “_t” to the end of all type names Why? Because e.g. X :attr = … is ambiguous Is X a type for a global attribute or a variable?

netCDF4 in CDL: Groups Syntax: group: g {…} [Note the colon] A group can itself contain types, dimensions, variables, and (nested) groups Name prefixing allows references to types and dimensions that reside in other groups Example: /g/cmpd_t => Do not use ‘/’ in your names Pretty much like the Unix file system Or Windows, but using forward slashes

Scope Rules Scope rules determine how references to a dimension or type without a prefix are interpreted General rule: Look in immediately enclosing group Look in the parent of the immediately enclosing group and so on up the enclosing groups For dimensions, if not found => error For types, continue to search the whole file to find a unique match, then error if not found

Specifying Data Constants Constants for user defined types require the use of braces {…} in certain places. dimensions: d=2; types: int(*) vlen_t; compound cmpd_t { int64 f1; string f2;}; variables: vlen_t v1(d); cmpd_t v2(d); data: v1 = {7, 8, 9}, {17,18,19, 20, 21}; v2 = {107, “abc”}, {1234567, “xyz”};

Rules for Using Braces The top level is automatically assumed to be a list of items, so it should not be inside {...} (Different than C constants lists). UNLIMITED dimension instances (other than the outer dimension) must be surrounded by {...} in order to specify the size. Vlen instances must be surrounded by {...} in order to specify the size. Compound instances must be embedded in {...} Non-scalar fields of compound instances must be embedded in {...}. Datalists associated with attributes are implicitly a vector (i.e., a list) of values of the type of the attribute and the above rules must apply with that in mind. No other use of braces is allowed (esp. for arrays)

Special Attributes Special attributes specified in an ncgen CDL file will be properly handled Consistent with ncdump -s Global special attributes “_Format” – specify the netCDF file format “classic” (equivalent to –k1) “64-bit offset” (-k2) “netCDF-4” (-k3) “netCDF-4 classic model” (-k4) _Format is overridden by command line -k flag

Special Attributes (cont.) Per-variable special attributes _Storage – constant string “contiguous” or “chunked” to set storage mode _ChunkSizes – 1-d array of integer chunk sizes;1 per dimension _DeflateLevel – (integer range 0-9) compression level _Endianness – constant strings “big” or “little” _Fletcher32 – boolean to set check summing _NoFill – boolean sets persistent NoFill property _Shuffle – boolean to enable/disable shuffle filter Note: boolean value can be “true”, “1”, “false”, or “0”

NCGEN Command Synopsis Primary Command Line Option Extensions [-k <file_format>] Format of the file to be created 1 => classic 32 bit 2 => classic 64 bit 3 => netcdf-4/CDM 4 => classic, but stored in netcdf-4 file format [-l <language>] Currently C (full netcdf-4 support); Java, F77 (netcdf-3 only); default => binary output with full netcdf-4 support <filename> Input CDL file

Extended Example An extended example is included in the ncgen man page http://www.unidata.ucar.edu/software/netcdf/docs/ncgen-man-1.html

Questions?

Debugging Note CDL: dimensions: u = unlimited; variables: v1(u); v2(u); data: v1 = {1,2,3,4}; v2 = {7,8}; Ncdump produces v2 = {7,8,_,_}; Use the “Cycle” Use ncgen to convert your <file>.cdl to <file>.nc Then use ncdump to convert your <file>.nc to <file2>.cdl Compare <file>.cdl to <file2>.cdl Watch out for UNLIMITED!