Global difference maps

From: Madeleine Patterson <madeleine.patterson77_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 28 2011 - 22:29:41 MST

Hi,

Am having trouble with a script: I am trying to plot a global map of the
difference between a variable from 2 model runs, and even though I try to
copy the var coords from the annual mean variable to the final difference
variable, what I'm doing (following advice from a previous exchange with an
ncl expert at ucar) doesn't seem to be working for me. Could anyone suggest
something I could try?

Also, can anyone suggest a script that sets out how to make a pretty shaded
contour plot with labelled color bar?

Thanks,

Maddy

*********

begin

; loading libraries

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"

setfileoption("nc","SuppressClose",False)

all_files1 = systemfunc("ls modelrun1_output.*")

fall1 = addfiles(all_files1,"r") ;

ListSetType(fall1,"cat")

tref_mod1_all = fall1[:]->TREF

all_files2 = systemfunc("ls modelrun2_output.*")

fall2 = addfiles(all_files2,"r")

ListSetType(fall2,"cat")

tref_mod2_all = fall2[:]->TREF

; Get annual means for 20 yr period

tref_mod1_annmean = month_to_annual(tref_mod1_all,1)

tref_mod2_annmean = month_to_annual(tref_mod2_all,1)

; THE AVERAGE OF THE ANNUAL MEANS OF THE 20 YEARS!!!

tref_mod1_avgd = dim_avg_Wrap(tref_mod1_annmean)

tref_mod2_avgd = dim_avg_Wrap(tref_mod2_annmean)

; GET THE DIFFERENCE BETWEEN THE RUNS

diff_tref_avgd=(/tref_mod1_avgd-tref_mod2_avgd/)

copy_VarCoords(tref_mod1_annmean,diff_tref_avgd)

diff_tref_avgd&lon@units = "degrees east"

diff_tref_avgd&lat@units = "degrees north"

printVarSummary(diff_tref_avgd)

wks =gsn_open_wks("x11","diff_tref_avgd")

res = True

res@tiMainString = "Difference maps for tref"

plot = gsn_csm_contour_map_ce(wks,diff_tref_avgd,res)

end

****

ERROR message I'm getting:

Variable: diff_tref_avgd

Type: float

Total Size: 7280 bytes

            1820 values

Number of Dimensions: 2

Dimensions and sizes: [year | 20] x [lat | 91]

Coordinates:

            lat: [ -90.. 90]

fatal:(lon) is not a named dimension in variable (diff_tref_avgd).

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 28 22:29:48 2011

This archive was generated by hypermail 2.1.8 : Wed Mar 02 2011 - 09:18:13 MST