Visualizing data in Cubed-Sphere grid
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.
- 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.
- Users should specify the time, level , variable’s name and file name in driver.m
- 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:
- 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 HU_getc180forweyium_c180.geosgcm_prog.20000414_2200z.nc4 to the same folder.
- To show example 1, $python example1.py
- 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:
- 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.
- 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
convert_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.
- run $ESMADIR/src/GMAO_Shared/GEOS_Util/plots/configure. This will produce a .quickplotrc in that directory
- source $ESMADIR/src/GMAO_Shared/GEOS_Util/plots/.quickplotrc
- run grads
- sdfopen file.nc4
- run command dc to plot the cube-sphere grid NetCDF file. Users can get help by just run dc without any argument.