Moorea-co3-Script

From coral
Jump to: navigation, search

Moorea-co3.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:
; d5528794-ad4d-4205-8ffd-cd4c74634c09
; 38e42732-c987-4316-b612-51bd2b23d406
; fa9eee3b-2e5f-43c6-a79f-68473124741d
; aa325901-2960-43f8-98f5-cae42166e185
; 72994fe7-fa0d-4a3c-b632-e2727981b010
; ec68eb67-4963-40f3-a361-fa2456005612
; e45af868-afa8-49b3-a5bd-4588e58002d9
; bf5fe67b-e515-4790-b69b-6513bc6b4eaa
; 1d057a24-0166-4f54-9860-f5b3fbb3bccf
; 7c5c11a6-a865-4dfc-9629-97d4c7824eac
; 72797382-146a-47a4-b8d0-6f6f9940b800
; 799ca0a7-b90b-4809-88b0-23e4f1e67343
; 0e2fb2ce-b885-4efb-b2d2-fc4fd9042037
; 7f4a65e8-a446-499c-a6b3-4d06e33155fa
; e232f638-40e1-4db5-96f9-26dbd06e8e07
; a56b962b-23af-4abd-8a92-b92a4cbab231
; 95893e14-5793-4928-89c7-c523e99f9df4
; 4df6479a-a1ce-4237-a3b9-e5001fb174d8
; 92afe2d9-682e-4fd5-879f-acfaffb9260d
f = addfiles((/"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_200601-201012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_201101-201512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_201601-202012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_202101-202512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_202601-203012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_203101-203512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_203601-204012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_204101-204512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_204601-205012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_205101-205512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_205601-206012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_206101-206512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_206601-207012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_207101-207512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_207601-208012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_208101-208512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_208601-209012.nc",
"co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_209101-209512.nc","co3_Omon_GFDL-ESM2M_rcp85_r1i1p1_209601-210012.nc"/), "r")

; Pick the co3 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
co3 = f[:]->co3(:,66,130)

; Compute a 60 month running average of co3
co32 = runave_n_Wrap(co3,60,0,0)

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

; Compare minimum/maximum of running average.
;
; print(min(co32) / max(co32))
; (0)	0.6018063

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

res = True
res@gsnDraw = False
res@gsnFrame = False
res@tiMainString = "Surface Carbonate 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

res@tiYAxisString = "CO~B~3~N~~S~2-~N~ Concentration (mol m~S~-3~N~)"

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

res@xyLineColor = "blue"

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

overlay(plot1, plot2)

draw(plot1)
frame(wks)

end