Hi all,
I used this script to make the evans plot of seasonal precipitation with
GPCP data and it works, but with other data I get an error message. It
begins to do, but stop at a certain point. Does anyone know why this is
happening?
Thanks in advance.
Part of my ncl code (below) and the ncl_filedump
--------
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"
load "evans_plot.ncl"
arquivo ="prec_mensal1998_2011s.nc"
a = addfile(arquivo,"r")
ylat = a->lat
xlon = a->lon
u = a->precip
;print(u)
ny = dimsizes(ylat)
nx = dimsizes(xlon)
var_new = new((/ny,nx/),"float",getFillValue(u))
var_new!0 = "lat"
var_new!1 = "lon"
var_new&lat = fspan(-88.57217,88.57217,ny)
var_new&lon = fspan(0,358.125,nx)
var_new&lat@units = "degrees_north"
var_new&lon@units = "degrees_east"
tempo = new((/ny,nx/),"float",getFillValue(u))
tempo!0 = "lat"
tempo!1 = "lon"
tempo&lat = fspan(-88.57217,88.57217,ny)
tempo&lon = fspan(0,358.125,nx)
tempo&lat@units = "degrees_north"
tempo&lon@units = "degrees_east"
do lat = 0,ny-1
do lon = 0,nx-1
var = u(:,lat,lon)
max_var = max(var)
indMax = ind(var .eq. max_var )
---------------> line 61
index = indMax(0) + 1
; index = mod(get1Dindex(var,max_var),4)+1 ; Does
not work with repeating data
var_new(lat,lon) = max_var
tempo(lat,lon) = index
if (dimsizes(indMax).gt.1) then ; are there multiple places
where var(:).eq.max_var?
print("The following had "+dimsizes(indMax)+" index values = max_var")
end if
print("lat_i: " + lat + " lon_j: " + lon + " valor: " +
max_var + " estacao: " + index)
end do
end do
printMinMax (var_new, True)
--------
NCAR Command Language Version 5.2.0
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
(0) Numero de pontos de latitude : 96
(0) Numero de pontos de longitude : 192
(0) lat_i: 0 lon_j: 0 valor: 0.0982143 estacao: 3
(0) lat_i: 0 lon_j: 1 valor: 0.0982143 estacao: 3
(0) lat_i: 0 lon_j: 2 valor: 0.0982143 estacao: 3
(0) lat_i: 0 lon_j: 3 valor: 0.0982143 estacao: 3
(0) lat_i: 0 lon_j: 4 valor: 0.0982143 estacao: 3
(0) lat_i: 0 lon_j: 5 valor: 0.0952381 estacao: 3
(0) lat_i: 0 lon_j: 6 valor: 0.0892857 estacao: 3
(0) lat_i: 0 lon_j: 7 valor: 0.0892857 estacao: 3
(0) lat_i: 0 lon_j: 8 valor: 0.0892857 estacao: 3
(0) lat_i: 0 lon_j: 9 valor: 0.0892857 estacao: 3
fatal:Number of dimensions on right hand side do not match number of
dimension in left hand side
fatal:Execute: Error occurred at or near line 61 in file
seasonal_prec_model.ncl
filename: prec_mensal1998_2011s
path: prec_mensal1998_2011s.nc
file global attributes:
CDI : Climate Data Interface version 1.6.2 (
http://code.zmaw.de/projects/cdi)
Conventions : CF-1.4
history : Mon Sep 30 22:18:27 2013: cdo yseasmean
prec_mensal1998_2011.nc prec_mensal1998_2011s.nc
Mon Sep 30 22:18:11 2013: cdo -f nc import_binary prec_mensal1998_2011.ctl
prec_mensal1998_2011.nc
CDO : Climate Data Operators version 1.6.2rc2 (
http://code.zmaw.de/projects/cdo)
dimensions:
lon = 192
lat = 96
time = 4 // unlimited
variables:
double lon ( lon )
standard_name : longitude
long_name : longitude
units : degrees_east
axis : X
double lat ( lat )
standard_name : latitude
long_name : latitude
units : degrees_north
axis : Y
double time ( time )
standard_name : time
units : hours since 1998-01-01 12:00:00
calendar : standard
float precip ( time, lat, lon )
long_name : ** sfc TOTAL PRECIPITATION
(KG/M2/DAY )
grid_type : gaussian
_FillValue : 9.999e+20
missing_value : 9.999e+20
-- Graziela Luzia Projeto Modelo Brasileiro do Sistema Climático Global - MBSCG Instituto Nacional de Pesquisas Espaciais - INPE Rod. Presidente Dutra, Km 40, 12.630-000, Cachoeira Paulista, SP, Brasil T: +55 (12) 3186-8614
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 3 15:52:32 2013
This archive was generated by hypermail 2.1.8 : Fri Oct 04 2013 - 16:45:17 MDT