NCO can produce 2D UGRID output

Skip to first unread message

Charlie Zender

Apr 26, 2017, 2:10:42 PM4/26/17
to UGRID Interoperability
UGRID folks,

The latest stable version of NCO, 4.6.6, supports some 2D UGRID.
The support is limited to 2D rectangular grids.
NCO can "infer" the UGRID representation of (I think) any such grid.
It outputs both a SCRIP gridfile and UGRID meshfile corresponding to
the 2D rectangular input datafile: 

ncks --rgr nfr=y --rgr ugrid=${HOME}/ \
     --rgr grid=${HOME}/ ~/ ~/

Here ugrid is the UGRID output, and grid is the SCRIP output, is any data file (that will not be touched) on the
desired 2D rectangular grid. It must contain orthogonal 1D lat and lon
arrays (NCO can generate any 2D rectangular grid to input). is any dummy netCDF file and will be overwritten.
I'll integrate the UGRID switch into ncremap in NCO 4.6.7.
The UGRID output has all required and lacks these optional fields:
face_edge_connectivity face_face_connectivity edge_face_connectivity. 
You can download the three files above at

Rectangular global meshes do not really exploit the power of UGRID,
but implementing this simple use-case helped me to learn UGRID.
I discovered SGRID after finishing the UGRID implementation :)
I may add an SGRID output option to NCO for 2D rectangular meshes.
Not sure if NCO will ever implement UGRID on more complex meshes.
Feedback always welcome.


Reply all
Reply to author
0 new messages