;**************************************************************************** ; Author : Josh Grant, COAPS ; ; Description : This program is used to calculate the divergence from a gridded ; dataset. In this case it is reading a NSCAT data that has been ; already gridded and will then be output to a file. This is ; also only computed divergence for the monthly NSCAT dataset. ; ; **Warning** : Due to poor planning on my part and lack of time the bulk of ; this program is not commented like it should be. ;**************************************************************************** @calc_grid_div.pro base = "/Net/NSCAT/people/grant/diverg_proj/" dataDirectory = base + "grid2div/data/winds/monthly/" saveDirectory = base + "grid2div/data/diverg/monthly/" stringFormat = STRCOMPRESS( '(i' + STRING( 2 ) + '.' $ + STRING( 2 ) + ')', /REMOVE_ALL ) delta = 2.0 miss = 99999.0 u = FLTARR( 360, 180 ) v = FLTARR( 360, 180 ) diverg = FLTARR( 360, 180 ) start = 9 endday = 12 FOR year = 1996, 1997 DO BEGIN IF ( year EQ 1997 ) THEN BEGIN start = 1 endday = 7 ENDIF FOR number = start, endday DO BEGIN file_name = dataDirectory + STRTRIM( year, 1 ) + $ STRING( number, format = stringFormat ) + '.monavg' READ_NSCAT_GRID, file_name, u, v, error IF ( error EQ 0 ) THEN BEGIN CALC_GRID_DIV, u, v, delta, miss, diverg file_name = saveDirectory + STRTRIM( year, 1 ) + $ STRING( number, format = stringFormat ) + ".mondiv" WRITE_GRID_DIV, file_name, diverg ENDIF ENDFOR ENDFOR END