Commit 740b2e11 authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Fri Oct 9 00:00:14 EDT 2015

parent fe4dd6fd
......@@ -6,17 +6,6 @@
; Description: Calculate either mean or variance map
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"
load "$CJS_NCL_LIB/print_clock.ncl"
load "$CJS_NCL_LIB/lib.cjs_graphics.ncl"
undef ( "calc_meanvar" )
function calc_meanvar( \
......
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; sub.draw_meanvar.ncl
; Carl Schreck (cjschrec@ncsu.edu)
; September 2014
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Description: Calculate either mean or variance map
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load "/home/carl/projects/olr_cdr/compare/sub.calc_meanvar.ncl"
undef ( "draw_meanvar" )
function draw_meanvar( \
i_meanNotVar [1] : logical, \
i_res [1] : logical, \
i_cntRes [1] : logical \
)
begin ; draw_meanvar
; These are some parameters that could be useful to have up top
varName = "olr"
minYear = 1981
maxYear = 2010
if( i_meanNotVar ) then
fileName = "olr.total.nc"
units = "W m-2"
else
fileName = "olr.anom.nc"
units = "(W m-2)^2"
end if
hirsPath = "/home/carl/data/olr/compare/hirs/" + fileName
avhrrPath = "/home/carl/data/olr/compare/avhrr/" + fileName
hirsData = calc_meanvar( hirsPath, varName, minYear, maxYear, i_meanNotVar )
avhrrData = calc_meanvar( avhrrPath, varName, minYear, maxYear, i_meanNotVar )
avhrrRegrid = copy_Gridding( hirsData, avhrrData )
diffData = hirsData - avhrrData
; Customize base plot
res = True
res@lbOrientation = "Horizontal"
res@lbTitleString = units
res@mpMinLatF = -60
res@mpMaxLatF = 60
res@gsnMajorLonSpacing = 45
res@gsnMinorLonSpacing = 15
res@gsnRightString = minYear + " - " + maxYear
res@cnFillPalette = "CBR_wet"
if( meanNotVar ) then
res@gsnSpreadColorStart = 10
res@gsnSpreadColorEnd = 0
end if
if( i_res ) then
copy_VarAtts( i_res, res )
end if
cntRes = True
if( i_cntRes ) then
copy_VarAtts( i_cntRes, cntRes )
end if
retVal = cjs_draw_shaded_map( wks, hirsData, res )
cjs_add_contours( wks, retVal, diffData, cntRes )
return(retVal)
end; draw_meanvar
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; meanvar.ncl
; Carl Schreck (cjschrec@ncsu.edu)
; September 2014
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Description: Compare maps of variance or mean
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/time_axis_labels.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/contrib/cd_string.ncl"
load "$CJS_NCL_LIB/lib.cjs_graphics.ncl"
load "$CJS_NCL_LIB/lib.array.ncl"
load "$CJS_NCL_LIB/print_clock.ncl"
load "/home/carl/projects/olr_cdr/compare/sub.calc_meanvar.ncl"
load "/home/carl/projects/olr_cdr/compare/sub.draw_meanvar.ncl"
begin ; main
print_clock( "Here we go!" )
; These are some parameters that could be useful to have up top
plotType = "png"
plotDpi = 200
plotName = "figures/total_meanvar_map"
print_clock( "Drawing the plot" )
; ...allows png or gif to work
if( ( plotType.eq."png" ).or.( plotType.eq."gif" ) ) then
plotTypeLocal = "eps"
else
plotTypeLocal = plotType
end if
; ...open the workstation
wks = gsn_open_wks( plotTypeLocal, plotName )
meanNotVar = True
res = True
res@gsnLeftString = "Mean"
cntRes = True
cntRes@cnLevels = ispan(-5,5,1) * 5
meanPlot = draw_meanvar( meanNotVar, res, cntRes )
meanNotVar = False
res = True
res@gsnLeftString = "Variance"
cntRes = True
cntRes@cnLevels = ispan(-5,5,1) * 50
varPlot = draw_meanvar( meanNotVar, res, cntRes )
; Customize panel
panRes = True
panRes@gsnPanelYWhiteSpacePercent = 5
gsn_panel( wks, (/ meanPlot, varPlot /), (/ 2, 1 /), panRes )
print_clock( "Convert the image, if necessary" )
delete(wks)
if( isStrSubset( plotType, "png" ).or.isStrSubset( plotType, "gif" ) ) then
system( "convert -trim -border 5x5 -bordercolor white " \
+ "+repage -density " + plotDpi + " " \\
+ plotName + ".eps " + plotName + "." + plotType )
end if
print_clock( "Thank you, come again." )
end; main
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment