;********************************************************* ; Calculate area average of eke and eke for 30 years ;********************************************************* 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" begin in = addfile("/data2/eke/control/ctrl.cam2.h0.1997-11-01-00000.nc","r") temp = in->T(0:29,1,:,:) temp_FillValue = -999 dimz = dimsizes(temp) nlat = 128 mlon = 256 nens = 2 printVarSummary(temp) ta = temp(0,:,:) ;*********************************************************** ; Read eke from ascii files and store seasonal mean into ; an array ;*********************************************************** eke_ltw = new((/nens,nlat,mlon/),"float") eke_ltw@_FillValue = -999 eke_ltw!0 = "year" eke_ltw!1 = "lat" eke_ltw!2 = "lon" t=0 do i= 1,2 eke_ltw(t,:,:) = asciiread("/data2/6-hourly/ensemble_run/tracks/eke_test"+i,(/nlat,mlon/),"float") t=t+1 end do n=0 if (any(ismissing(eke_ltw)))then print("Your data is missing") n=n+1 print(n) end if printVarSummary(eke_ltw) printMinMax(eke_ltw,True) ;*********************************************** ; Calculating ensemble mean of u ;*********************************************** eke_ens_av = dim_avg_n_Wrap(eke_ltw, 0) copy_VarCoords(ta,eke_ens_av) printVarSummary(eke_ens_av) printMinMax(eke_ens_av, True) ;************************************************* ;Plot ;************************************************* res = True res@gsnMaximize = True res@gsnSpreadColors = True res@cnFillOn = True res@cnLinesOn = False res@cnLevelSelectionMode = "ManualLevels" res@cnMinLevelValF = 0 res@cnMaxLevelValF = 1000 res@cnLevelSpacingF = 10 res@lbLabelStride = 10 res@lbOrientation = "vertical" ;vertical label bar res@tmLabelAutoStride = True res@tmXTOn = False res@tmYROn = False res@mpLimitMode = "LatLon" res@mpMinLatF = 10. res@mpMaxLatF = 80. res@mpMinLonF = 190. res@mpMaxLonF = 310. res@mpGeophysicalLineThicknessF = 1.5 ;***************************************************** ; Plot ;***************************************************** wks = gsn_open_wks("pdf","eke_mean") gsn_define_colormap(wks,"BlAqGrYeOrReVi200") plot = gsn_csm_contour_map_ce(wks,eke_ens_av(:,:),res) end