Re: ESMF_regrid_with_weights, dim size of output?

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Fri Jan 24 2014 - 14:49:15 MST

Thx for the printVarSummary(...)

xp has 2 dimensions: (192,132)

xw has three dimensions:
    [Time | 1] x [south_north | 192] x [west_east | 132]

Hence, the message: Number of dimensions do not match, can't continue
when you do:
    xdiff=xw-xp

The size of the time dimension is one. It is considered as 'degenerate'
so when you do xw(0,:,:) NCL will collapse to 2D

test = xw(0,:,:) ; will 'drop' the degenerate dimension
printVarSummary(test)

So, do the following

xdiff = xw(0,:,:)-xp

printVarSummary(xdiff)
print("xdiff: min="+min(xdiff)+" max="+max(xdiff))

On 1/24/14, 2:41 PM, burakows@ucar.edu wrote:
> Hello,
>
> I am using ESMF_regrid_with_weights to regrid an observational data set to
> my WRF grid. The regridding works, however, when I try to subtract my
> regridded observational data (xp) from the WRF file variable (xw), I get
> an error that says the number of dimensions do not match:
>
> xdiff = xw-xp
> fatal:Minus: Number of dimensions do not match, can't continue
>
> printVarSummary(xp)
> Variable: xp
> Type: float
> Total Size: 101376 bytes
> 25344 values
> Number of Dimensions: 2
> Dimensions and sizes: [192] x [132]
> Coordinates:
> Number Of Attributes: 7
> missing_value : 1e+20
> remap : remapped via ESMF_regrid_with_weights: Bilinear remapping
> lon2d : <ARRAY of 25344 elements>
> lat2d : <ARRAY of 25344 elements>
> long_name : z
> actual_range : ( -0.7599999904632568, 12.02999973297119 )
> _FillValue : 1e+20
>
>
> fw=addfile ("mywrffile.nc","r")
> xw=fw->T2max
>
> printVarSummary(xw)
> Variable: xw
> Type: float
> Total Size: 101376 bytes
> 25344 values
> Number of Dimensions: 3
> Dimensions and sizes: [Time | 1] x [south_north | 192] x [west_east | 132]
> Coordinates:
> Number Of Attributes: 6
> FieldType : 104
> MemoryOrder : XY
> coordinates : XLONG XLAT
> description : TEMP at 2 M
> stagger :
> units : C
>
>
> Thanks,
>
> Liz.
>
>
>
> _______________________________________________
> 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 Fri Jan 24 14:49:24 2014

This archive was generated by hypermail 2.1.8 : Fri Feb 07 2014 - 16:39:11 MST