[gradsusr] GFS With Climatology
Jennifer M Adams
jadams21 at gmu.edu
Thu Apr 14 10:37:12 EDT 2016
Hi, Stuart —
There is an example for creating a monthly climatology in the documentation for the ‘modify’ command — http://cola.gmu.edu/grads/gadoc/gradcomdmodify.html. Write out the defined climo to disk (using fwrite instead of sdfwrite so there is no time metadata attached to the file) and create a new data set (an example descriptor is copied below). The script sample is taken from what I use to create the temperature anomaly plots in the climate outlooks at http://wxmaps.org/pix2/clim.html. Most of this code is for figuring out weights (fac1 and fac2) for the monthly climatology values in order to match the time period of the 8-day average from the GFS forecast; that may be more complicated than necessary, you could probably just as easily use the climatology for the current month.
—Jennifer
'open /data/gfs0p25/ctl/latest.gfs'
'open /data/tclim.ctl'
setcols()
chrmon = 'JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC'
julian = ' 0 31 59 90 120 151 181 212 243 273 304 334'
julian_mid = ' 15 45 74 105 135 166 196 227 258 288 319 349 380'
tlast=65
'set dfile 1'
'set t 'tlast
'q time'
txtdat = subwrd(result,3)
txtday = substr(txtdat,4,2)
txtmon = substr(txtdat,6,3)
imon = 1
while(imon<13)
lmon = imon - 1
monmon = subwrd(chrmon,imon)
if (monmon = txtmon)
if (imon > 1)
res = subwrd(julian,imon)
else
res = 0
endif
mrfjul = res + txtday
break
endif
imon = imon + 1
endwhile
midjul = subwrd(julian_mid,imon)
if(mrfjul < midjul)
mon1 = imon - 1
mon2 = imon
if (mon1 = 0)
jul1 = -15
mon1 = 12
else
res = subwrd(julian_mid,mon1)
jul1 = res
endif
jul2 = midjul
fac1 = (jul2-mrfjul)/(jul2-jul1)
fac2 = (mrfjul-jul1)/(jul2-jul1)
else
mon1 = imon
mon2 = imon + 1
res = subwrd(julian_mid,mon2)
jul2 = res
jul1 = midjul
fac1 = (jul2-mrfjul)/(jul2-jul1)
fac2 = (mrfjul-jul1)/(jul2-jul1)
if (mon2 = 13)
mon2 = 1
endif
endif
time1 = mon1
time2 = mon2
* Define mean temperature
'set dfile 1'
'set t 1'
'tfcst = ave(t2m.1-273.16,t=2,t='tlast')'
* Define the climatological temperature for this period
'set dfile 2'
'set t 1'
'tclim = t(t='time1')*'fac1'+t(t='time2')*'fac2
* Draw the anomaly
'd tfcst-lterp(tclim,tfcst)'
p.s. The contents of the descriptor file (tclim.ctl) look like this:
DSET ^tclim.dat
UNDEF -9.99e+33
TITLE CRU mean surface temperature climatology 1901-2000 Regridded
XDEF 360 linear 0 1
YDEF 181 linear -90 1
ZDEF 1 LEVELS 1
TDEF 12 LINEAR JAN1979 1mo
VARS 1
t 0 0 mean temperature [C]
ENDVARS
On Apr 14, 2016, at 5:50 AM, Chorley Weather <weatherstu at chorleyweather.com<mailto:weatherstu at chorleyweather.com>> wrote:
Hi all,
I've wanted to create anomaly charts for some time now using data from the GFS along side climatology data, say from 1981-2010, perhaps using CFSR. However I'm unsure where to start with this really, is there anybody who could throw some advice or perhaps an old script that I could teach myself. Any help would be greatly appreciated.
Best regards,
--
Stuart Markham
[http://www.chorleyweather.com/forecast-charts/SampleDatasets/logo%20450x100.PNG]
_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org<mailto:gradsusr at gradsusr.org>
http://gradsusr.org/mailman/listinfo/gradsusr
--
Jennifer Miletta Adams
Center for Ocean-Land-Atmosphere Studies (COLA)
George Mason University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20160414/93b326ab/attachment.html
More information about the gradsusr
mailing list