Visualizing data in Cubed-Sphere grid: Difference between revisions

From GEOS-5
Jump to navigation Jump to search
Line 27: Line 27:
For the new format of the output, users can use the python codes here to transform the data to lat-lon grid and visualize the products:
For the new format of the output, users can use the python codes here to transform the data to lat-lon grid and visualize the products:
#Install python 3 (or above) and the modules numpy, netcdf4, matplotlib and mpl_toolkits  on your computer.  
#Install python 3 (or above) and the modules numpy, netcdf4, matplotlib and mpl_toolkits  on your computer.  
#Download source codes CSnative.py, example1.py, example2.py and the example data file  [[Media:TEST7.geosgcm_prog.20000415_0000z.nc4]] the same folder.
#Download source codes CSnative.py, example1.py, example2.py and the example data file  [[TEST7.geosgcm_prog.20000415_0000z.nc4]] the same folder.
#To show example 1, $python example1.py  
#To show example 1, $python example1.py  
#To show example 2, $python example2.py
#To show example 2, $python example2.py

Revision as of 05:45, 29 March 2017

IN PROGRESS

Cubed-Sphere grid background

Several GEOS-5 products are now produced on the native cubed-sphere computational grid. Although this format may be less familiar, this choice has several advantages for some user communities. In particular, the Chemical Transport Modeling (CTM) community can use native mass-flux products to significantly improve conservation properties when running with GEOS-5. To minimize transition difficulties for GEOS-5 data consumers, this page provides instructions for visualizing cubed-sphere data products using a variety of common packages: python, Matlab, IDL, and GRaDS, and Panoply. This page also provides instructions for downloading and building an executable that can regrid cubed-sphere products onto a traditional lat-lon grid.

Fortran

To map the cubed-sphere grid data to lat-lon gird data, the program c2l_CFIO_offline.x is built with AGCM at src/GEOSgcs_GridComp/GEOSgcm_GridComp/GEOSagcm_GridComp/GEOSsuperdyn_GridComp/FVdycoreCubed_GridComp. The example configure file c2l_CFIO_offline.rc is also generated. It should be run as mpirun –np 6 ./c2l_CFIO_offline.x. This will produce a lat-lon grid data file whose name is configured in c2l_CFIO_offline.rc. Users then can use their familiar tools to visualize the lat-lon grid data.

Matlab

Users can find a “GridUtils” package in MATLAB ( R2015b and R2016a or above) at http://wiki.seas.harvard.edu/geos-chem/index.php/GEOS-Chem_HP_Output_Data#MATLAB_.28Cubed-sphere_and_regular_data.29 . The instructions are straight forward. Although it is intended for GCHP, it can be used for all the other outputs that use the same formats as that of GCHP. For the new format of the output, users can use the matlab codes here to transform the data to lat-lon grid and visualize the products.

  1. Download source codes and save them as driver.m, CSnative.m, extendFace1.m,extendFace3.m, extendFace4.m, extendFace6.m, and the example data file respectively to the same folder. The extendFace(1-6).m are used to fill the seam between cubed-sphere faces. Face2 and Face5 are not necessary to be extended because they are redundant.
  2. Users should specify the time, level , variable’s name and file name in driver.m
  3. Run with Matlab: % driver

driver.m

CSnative.m

extendFace1.m

extendFace3.m

extendFace4.m

extendFace6.m

Python

For the new format of the output, users can use the python codes here to transform the data to lat-lon grid and visualize the products:

  1. Install python 3 (or above) and the modules numpy, netcdf4, matplotlib and mpl_toolkits on your computer.
  2. Download source codes CSnative.py, example1.py, example2.py and the example data file TEST7.geosgcm_prog.20000415_0000z.nc4 the same folder.
  3. To show example 1, $python example1.py
  4. To show example 2, $python example2.py

CSnative.py

example1.py

example2.py

IDL

To use IDL codes and the pbs scripts to visualize a large number of GEOS-5 cubed-sphere products:

  1. Download the codes and save them as cube_to_latlon.pro, winds_cube_to_latlon.pro, convert_latlon.j (pbs script) , idlstart ( environment ) and README.
  2. The README file explains all the scripts and the steps visualizing the data. Although all the examples and data are on discover, it is not difficult for users to make changes to run the programs on the other systems.

README

idlstart

Ops12KM_R_to_latlon.j

cube_to_latlon.pro

winds_cube_to_latlon.pro

GrADS

To use GrADS to display cube-sphere grid data in a NetCDF file, the path should be in the PATH environment: /discover/nobackup/projects/gmao/share/dasilva/opengrads/Contents/grads

Then the users can follow the steps. First, we assume a version of GEOS-5 is available.

  1. run $ESMADIR/src/GMAO_Shared/GEOS_Util/plots/configure. This will produce a .quickplotrc in that directory
  2. source $ESMADIR/src/GMAO_Shared/GEOS_Util/plots/.quickplotrc
  3. run grads
  4. sdfopen file.nc4
  5. run command dc to plot the cube-sphere grid NetCDF file. Users can get help by just run dc without any argument.

Panoply

Now the Panoply after version 4.7.0 can view the native cubed-sphere products. This software can be downloaded from https://www.giss.nasa.gov/tools/panoply/

Converting (interpolating) cubed-sphere data to Lat-Lon data

For some purposes it will be impractical to adapt existing analysis tools to directly work with MERRA cubed-sphere products. In such cases, users will need to build an executable that can interpolate cubed-sphere data to a set of predefined lat-lon resolutions. (Note that special care must be taken for vector data, e.g., (u,v).)

The building requirements and instruction can be found here https://geos5.org/wiki/index.php?title=Building_Baselibs . The executable program cube2laton can be used to convert (or interpolate) the data


Converting data:

% cube2latlon <in-file> <out-file> <target-resolution>

E.g.,

% cube2latlon merra.nc latlon.nc 4x5