Skip to main content.

Post-processing tools


dg2nc
Convert DaViE .dg files to netCDF .nc files. This is useful for extracting variables for quick viewing with ncview, but can also convert an entire dg file (assuming standard diagnostics)
! Invocation is:
!      dg2nc afile.dgXXXX [-im] [-o <output.nc>] [-v <variable>]
!    
! Flags:
!         -o <output.nc>   Send output to output.nc (If this option is 
!                          not used, the default output is to
!                          afile_XXXX.nc 
!         -v <variable>    Only get data for <variable>
!                          N.B. This can have multiple specifications
!         -i               Force writing over existing file
!         -m               Modify existing file rather than recreating
!
! Example usage:
!      dg2nc -v THBAR file1.dg0001 -o file2.nc
!  This invocation will output the variable VBAR from file1.dg0001 to
!  the output file file2.nc (Note all dimensional information is written
!  to file2.nc not just that required for THBAR.  file2.nc will be 
!  created if it doesn't already exist else the user will be prompted
!  whether to overwrite.  If the user wishes to modify file2.nc they
!  should use the -m flag (see next example).
!
!      dg2nc file1.dg0020 -i -m -v UBAR -v VBAR -o file2.nc
!  This invocation takes the variables UBAR and VBAR from the DaViE
!  file file1.dg0020 and modifies the existing netCDF file file2.nc 
!  N.B. The existing file2.nc must already contain the correct 
!  dimension information for the variables UBAR and VBAR
!