wiki:NCLExamples
Last modified 6 years ago Last modified on 04/05/12 21:41:05

Different ways of plotting HOMME grid data

This run is an "ne9np8" test case.

The original HOMME grid has 23816 cells and 20 levels. It uses an 8x8 grid of Gauss-Labatto points instead of the normal 4x4.

A single 3D variable takes up 3.8MB.

Plotting data directly from model

Passing in 3 1D arrays

Original

    (abbreviated code)
    sfile   = addfile("data_ne9np8.nc","r")
    zeta    = sfile->zeta
    lon1d   = sfile->lon
    lat1d   = sfile->lat

    res_orig@sfXArray = lon1d
    res_orig@sfYArray = lat1d
    plot_orig   = gsn_csm_contour_map(wks,zeta(lasttime,20,:),res_orig)

Using connectivity information

orig with connectivity

  f1 = addfile("ne9np8_metadata.nc","r")
  el_corners = f1->element_corners
  t_el = el_corners(ncells|:,ncorners|:)
  size = dimsizes(t_el)
  tri_el = new((/2 * size(0),3/), integer)
  tri_el(::4,:) = t_el(::2,(/0,1,2/))           !  convert the quads into triangles
  tri_el(1::4,:) = t_el(::2,(/2,3,0/))  
  tri_el(2::4,:) = t_el(1::2,(/1,2,3/))
  tri_el(3::4,:) = t_el(1::2,(/3,0,1/)) 

   res@sfXArray            = lon1d        ; Required to tell NCL where to
   res@sfYArray            = lat1d        ; overlay data on globe.
   res@sfElementNodes      = tri_el
   res@sfFirstNodeIndex    = 1

    plot   = gsn_csm_contour_map(wks,zeta(lasttime,20,:),res)

Plotting data after interpolation to lat/lon grid

Interpolate internally in HOMME to 192x384 grid

Internal Interp

ESMF Bilinear to 1 degree grid

Plotting after binlinear map to lat/lon

ESMF Patch to 1 degree grid

Plot after patch mapping

Attachments