Commit 96c5ca69 authored by Carl Schreck's avatar Carl Schreck
Browse files

Automated Nightly Commit - Thu Oct 2 00:01:25 EDT 2014

parent be86b5a5
#!/bin/bash
NCL_SCRIPT=write_time_series
echo $JOB_NAME `date`
NCL_DIR=`pwd`
mkdir log
for VAR_NAME in olr mjo er kelvin low
do
for SENSOR in 20th avhrr hirs
do
NCL_OPTION="varName=\"$VAR_NAME\" sensor=\"$SENSOR\""
JOB_NAME="$SENSOR"."$VAR_NAME"
qsub \
-N $JOB_NAME \
-o $NCL_DIR/log/$JOB_NAME.log -j oe \
-q san \
-l walltime=12:00:00,nodes=1:ppn=1 \
-v NCL_DIR=$NCL_DIR,NCL_SCRIPT=$NCL_SCRIPT,NCL_OPTION="$NCL_OPTION" \
$NCL_DIR/run_ncl.pbs
done
done
#!/bin/bash
cd $NCL_DIR
unbuffer ncl $NCL_SCRIPT.ncl $NCL_OPTION
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; write_time_series.ncl
; Carl Schreck (cjschrec@ncsu.edu)
; October 2014
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Description: Write total and standardized time series of OLR data averaged
; over a box
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
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/print_clock.ncl"
load "$CJS_NCL_LIB/latlon_string.ncl"
begin ; main
print_clock( "Here we go!" )
; These are some parameters that could be useful to have up top
if(.not.isvar( "sensor" ) ) then
sensor = "avhrr"
end if
if(.not.isvar("varName") ) then
varName = "olr"
end if
if( varName.eq."olr" ) then
fileName = "olr.anom.nc"
else
fileName = "olr.waves.nc"
end if
minLon = 00
maxLon = 360
minLat = -20
maxLat = 20
inPath = "/home/carl/data/olr/compare/" + sensor + "/" + fileName
outPath = "/home/carl/data/olr/compare/time_series/" + varName + "." \
+ sensor + "." + lat_string(minLat) + "-" + lat_string(maxLat) + ".nc"
timeUnits = "days since 1800-01-01 00:00:00"
climStart = cd_inv_calendar( 1981, 01, 01, 00, 0, 0, timeUnits, 0 )
climEnd = cd_inv_calendar( 2010, 12, 31, 18, 0, 0, timeUnits, 0 )
print_clock( "Reading" )
inFile = addfile( inPath, "r" )
inData = lon_subset( inFile->$varName$(:,{minLat:maxLat},:), minLon, maxLon )
time = inFile->time
print_clock( "Calculating series" )
inData = inData^2
totalSeries = dim_avg_n_Wrap( inData, (/ 1, 2 /) )
totalSereis = sqrt( totalSeries )
print_clock( "Standardizing series" )
mean = avg( totalSeries({climStart:climEnd}) )
std = stddev( totalSeries({climStart:climEnd}) )
anomSeries = ( totalSeries - mean ) / std
copy_VarMeta( totalSeries, anomSeries )
format = "%8.2f"
print( cd_string(time,"") + " " + sprintf( format, totalSeries ) \
+ sprintf( format, anomSeries ) )
print_clock( "Writing" )
system("rm " + outPath )
outFile = addfile( outPath, "c" )
outFile->time = time
outFile->total = totalSeries
outFile->anom = anomSeries
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