Commit 7a29d214 authored by Carl Schreck's avatar Carl Schreck

Automated Nightly Commit - Wed Feb 12 09:12:18 EST 2020

parent efab57ce
......@@ -17,13 +17,13 @@ begin ; main
varName = "prcp"
timeUnits = "days since 1800-01-01 00:00:00"
targetTime = cd_inv_calendar( 1952, 03, 11, 00, 0, 0, timeUnits, 0 )
targetTime = cd_inv_calendar( 2013, 09, 21, 00, 0, 0, timeUnits, 0 )
plotType = "png"
plotName = "figures/" + varName + cd_string( targetTime, ".%Y.%N.%D" )
print_clock( "Reading" )
; inPath = "~/data/nclimgrid/beta/merged/prcp.total.nc"
inPath = "~/data/nclimgrid/beta/merged/prcp.total.1951.1978.nc"
inPath = "~/data/nclimgrid/beta/merged/prcp.total.nc"
; inPath = "~/data/nclimgrid/beta/merged/prcp.total.1951.1978.nc"
inFile = addfile( inPath, "r" )
data = inFile->$varName$({targetTime},:,:)
data@_FillValue = default_fillvalue(typeof(data))
......
......@@ -18,7 +18,10 @@ begin ; main
varName = "prcp"
end if
if( .not.isvar("years") ) then
years = ".1951.1978"
; years = ".1951.1978"
; years = ".1981.2018"
years = ".2001.2018"
; years = ""
end if
inPath = "~/data/nclimgrid/beta/merged/" + varName + ".total" + years + ".nc"
......@@ -27,24 +30,24 @@ begin ; main
print_clock( "Reading" )
data = inFile->$varName$
if( varName.eq."prcp" ) then
print_clock( "Counting" )
thresh = (/ 25, 50, 75, 100, 150, 200, 250 /)
do t = 0, dimsizes(thresh)-1
above = where( data.ge.thresh(t), 1.0, 0.0 )
copy_VarCoords( data, above )
above = NewCosWeight(above)
count = dim_sum_n( above, (/ 1, 2 /) )
print_clock( "Finding max" )
print( "Max: " + max(count) + " " \
+ cd_string( data&time( maxind(count) ), "" ) )
end do
end if
; if( varName.eq."prcp" ) then
; thresh = (/ 25, 50, 75, 100, 150, 200, 250 /)
; do t = 0, dimsizes(thresh)-1
; print_clock( "Counting " + thresh(t) + "mm" )
; above = where( data.ge.thresh(t), 1.0, 0.0 )
; copy_VarCoords( data, above )
; above = NewCosWeight(above)
; count = dim_sum_n( above, (/ 1, 2 /) )
; print_clock( "Finding max" )
; print( "Max: " + max(count) + " " \
; + cd_string( data&time( maxind(count) ), "" ) )
; end do
; end if
data = where( data.eq.0, data@_FillValue, data )
; data = where( data.eq.0, data@_FillValue, data )
print_clock( "Weighting" )
data = NewCosWeight(data)
; data = NewCosWeight(data)
print_clock( "Averaging" )
mean = dim_avg_n_Wrap( data, (/ 1, 2 /) )
......
Markdown is supported
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