Re: fatal:Dimension sizes of left hand side and right hand side of assignment do not match

From: Wei Huang <huangwei_at_nyahnyahspammersnyahnyah>
Date: Mon Jun 02 2014 - 16:18:16 MDT

Vanucia,

You may try change your code:

file_name = addfile("sit_OImon_CanCM4_decadal1980_r1i1p1_198101-199012.nc",
"r")
var = file_name->sit
file_create = addfile("teste2.nc", "c")
new_lon = fspan(0, 357, 180)
new_lat = fspan(-87.86, 87.86, 90)
new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
new_var!0 ="lat"
new_var!1 = "lon"
new_var&lat = new_lat
new_var&lon = new_lon
new_var&lat@units = "degrees_north"
new_var&lon@units = "degrees_east"
file_create->media = new_var

to:

file_name = addfile("sit_OImon_CanCM4_decadal1980_r1i1p1_198101-199012.nc",
"r")
var = file_name->sit
file_create = addfile("teste2.nc", "c")
new_lon = fspan(0, 357, 180)
new_lat = fspan(-87.86, 87.86, 90)
new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
file_create->media = new_var

If this did not work, please again add printVarSummary(new_var) before
file_create->media = new_var.

You may try again with:

file_name = addfile("sit_OImon_CanCM4_decadal1980_r1i1p1_198101-199012.nc",
"r")
var = file_name->sit
time = file_name->time
file_create = addfile("teste2.nc", "c")
new_lon = fspan(0, 357, 180)
new_lat = fspan(-87.86, 87.86, 90)
new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
new_var!0 = "time"
new_var!1 ="lat"
new_var!2 = "lon"
new_var&time = time
new_var&lat = new_lat
new_var&lon = new_lon
new_var&lat@units = "degrees_north"
new_var&lon@units = "degrees_east"
file_create->media = new_var

Wei

On Mon, Jun 2, 2014 at 3:56 PM, Van煤cia Schumacher <
vanucia-schumacher@hotmail.com> wrote:

> Hi Wei,
>
> Variable: new_lon
> Type: float
> Total Size: 720 bytes
> 180 values
> Number of Dimensions: 1
> Dimensions and sizes: [180]
> Coordinates:
>
> Variable: new_lat
> Type: float
> Total Size: 360 bytes
> 90 values
> Number of Dimensions: 1
> Dimensions and sizes: [90]
> Coordinates:
>
> Variable: new_var
> Type: float
> Total Size: 7776000 bytes
> 1944000 values
> Number of Dimensions: 3
> Dimensions and sizes: [time | 120] x [LAT | 90] x [LON | 180]
> Coordinates:
> time: [47830.5..51449.5]
> LAT: [-87.86..87.86]
> LON: [ 0..357]
> Number Of Attributes: 11
> _FillValue : 1e+20
> standard_name : sea_ice_thickness
> long_name : Sea Ice Thickness
> comment : the mean thickness of sea ice in the ocean portion of the
> grid cell (averaging over the entire ocean portion, including the ice-free
> fraction). Reported as 0.0 in regions free of sea ice.
> units : m
> original_name : SIC
> cell_methods : time: mean (interval: 20 minutes) area: mean where sea
> cell_measures : area: areacello
> history : 2011-05-05T18:21:10Z altered by CMOR: replaced missing value
> flag (1e+38) with standard missing value (1e+20).
> associated_files : baseURL:
> http://cmip-pcmdi.llnl.gov/CMIP5/dataLocation gridspecFile:
> gridspec_seaIce_fx_CanCM4_decadal1980_r0i0p0.nc areacello:
> areacello_fx_CanCM4_decadal1980_r0i0p0.nc
> missing_value : 1e+20
>
> fatal:Dimension sizes of left hand side and right hand side of assignment
> do not match
>
>
>
> ---
> Van煤cia Schumacher
> Mestranda em Meteorologia - UFV
> Meteorologista -UFPel
> Departamento de Meteorologia Agr铆cola - DEA
> Cel: (31) 9978 2522
> DEA: (31) 3899 1890
>
>
> ------------------------------
> From: huangwei@ucar.edu
> Date: Mon, 2 Jun 2014 15:29:20 -0600
> Subject: Re: fatal:Dimension sizes of left hand side and right
> hand side of assignment do not match
> To: vanucia-schumacher@hotmail.com
> CC: ncl-talk@ucar.edu
>
>
> Vanucia,
>
> Can add:
>
> printVarSummary(new_lon)
> printVarSummary(new_lat)
> printVarSummary(new_var)
>
> before line:
>
> file_create->media = new_var
>
> and send the output to us?
>
> Thanks,
>
> Wei
>
>
>
> On Mon, Jun 2, 2014 at 6:19 AM, Van煤cia Schumacher <
> vanucia-schumacher@hotmail.com> wrote:
>
> I tried to change the resolution of the data to 2 degrees and I'm unable
> to find the solution error:
>
> fatal:Could not create (teste2.nc)
> fatal:Dimension sizes of left hand side and right hand side of assignment
> do not match
>
> 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
> file_name =
> addfile("sit_OImon_CanCM4_decadal1980_r1i1p1_198101-199012.nc", "r")
> var = file_name->sit
> file_create = addfile("teste2.nc", "c")
> new_lon = fspan(0, 357, 180)
> new_lat = fspan(-87.86, 87.86, 90)
> new_var = linint2_Wrap(var&lon,var&lat,var,True,new_lon,new_lat,0)
> new_var!0 ="lat"
> new_var!1 = "lon"
> new_var&lat = new_lat
> new_var&lon = new_lon
> new_var&lat@units = "degrees_north"
> new_var&lon@units = "degrees_east"
> file_create->media = new_var
> end
>
> print data:
>
> dimensions:
> time = 120 // unlimited
> lat = 64
> lon = 128
> bnds = 2
> variables:
> double time ( time )
> bounds : time_bnds
> units : days since 1850-1-1
> calendar : 365_day
> axis : T
> long_name : time
> standard_name : time
>
> double time_bnds ( time, bnds )
>
> double lat ( lat )
> bounds : lat_bnds
> units : degrees_north
> axis : Y
> long_name : latitude
> standard_name : latitude
>
> double lat_bnds ( lat, bnds )
>
> double lon ( lon )
> bounds : lon_bnds
> units : degrees_east
> axis : X
> long_name : longitude
> standard_name : longitude
>
> double lon_bnds ( lon, bnds )
>
> float sit ( time, lat, lon )
> standard_name : sea_ice_thickness
> long_name : Sea Ice Thickness
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Jun 2 16:18:48 2014

This archive was generated by hypermail 2.1.8 : Tue Jun 03 2014 - 11:40:09 MDT