Moorea-SST-Script

From coral
Jump to: navigation, search

Moorea-sst.png

The above chart was generated with the NCL script below. Newlines have been inserted for formatting.

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/contrib/time_axis_labels.ncl"

begin

; Data source:
;
; Dunne, John; John, Jasmin; Shevliakova, Elena; Stouffer, Ronald; Griffies, Stephen; Malyshev, Sergey; Milly, P.; Sentman, Lori; Adcroft, Alistair; Cooke, William; Dunne, Krista; Hallberg, Robert; Harrison, Matthew; Krasting, John; Levy, Hiram; Phillips, Peter; Samuels, Bonita; Spelman, Michael; Winton, Michael; Wittenberg, Andrew; Zadeh, Niki
; NOAA GFDL GFDL-ESM2M, rcp85 experiment output for CMIP5 AR5, served by ESGF
;
; Tracking IDs:
; 23fc9a5a-1991-4f34-aae7-ccb51fb4a7cd
; 7dad7861-aa49-4718-a5a5-1c0537265b16
; c1c787c1-c17a-470e-82c0-8eb3ca7f45ab
; 472bfe57-e52f-48f5-9077-f90b7a6015cc
; dc536e1c-2543-44d9-887e-e70b32de25c5
; fef066ce-d4ff-447f-ad0a-f881726a2607
; ee42642b-82c6-401c-972c-0c2ae9249038
; d8555ca0-8b48-4dbd-ab78-c403583bd4f6
; c778c67f-fc59-4692-a151-8e6b8c3c7e35
; 94b8424b-06ed-4bb9-ba10-ac45301b3f9d
; de81e857-0390-4aee-aac3-18f112c3cae2
; 6642808d-56c5-45b2-9b8c-0a0742755099
; 227796dd-fafb-4daf-bc66-f836376274f9
; ab5f92f8-a6d2-42b7-acf9-b6dc197fee0a
; a32aa2ad-b744-4e46-ba9c-1328229a5bdc
; 89330978-c69f-4a46-a529-92d68eae1ecb
; d0a550cb-9988-4898-87b7-95722e586564
; b0d91540-3f98-4714-972a-f7e1471e14bf
; 9cfab26d-0591-4c50-83fc-76f4501d4771
f = addfiles((/"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_200601-201012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_201101-201512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_201601-202012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_202101-202512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_202601-203012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_203101-203512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_203601-204012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_204101-204512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_204601-205012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_205101-205512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_205601-206012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_206101-206512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_206601-207012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_207101-207512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_207601-208012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_208101-208512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_208601-209012.nc",
"tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_209101-209512.nc","tos_Omon_GFDL-ESM2M_rcp85_r1i1p1_209601-210012.nc"/), "r")

; Pick the grid coordinate closest to Opunohu Bay on Moorea,
; at 17°30' S 149°52' W
;
; print(f->lat_vertices(66,0,0))
;  units :	degrees_north
; (0)	-17.10523414611816
;
; print(f->lon_vertices(0,130,0))
;  units :	degrees_east
; (0)	-150
tos = f[:]->tos(:,66,130)

; Convert K -> C
tos = tos - 273.15

; Compute a 60 month running average of tos
tos2 = runave_n_Wrap(tos,60,0,0)

; Extract times associated with each data point
time = tos&time

; Compute minimum/maximum of running average.
;
; print(min(tos2))
; 27.40779
;
; print(max(tos2))
; 29.48864

wks = gsn_open_wks("png","result")

res = True
res@gsnDraw = False
res@gsnFrame = False
res@tiMainString = "SST at Moorea"
restime = True
restime@ttmFormat = "%Y"

time_axis_labels(time,res,restime)

res@tmXBLabelFontHeightF = 0.01
res@tmXBLabelJust = "CenterRight"
res@tmXBLabelDeltaF = 1.0
res@tmXBLabelAngleF = 50.
res@tmLabelAutoStride = True

plot1 = gsn_csm_xy(wks, time, tos, res)

res@xyLineColor = "blue"

plot2 = gsn_csm_xy(wks, time, tos2, res)

overlay(plot1, plot2)

draw(plot1)
frame(wks)

end