[ncl-talk] problem with bilinear interpolation

Karin Meier-Fleischer meier-fleischer at dkrz.de
Thu Apr 2 04:56:39 MDT 2015


Hi Antonio,

I think you should have a look at you lines

   xlat = fspan(-90.,90,73)
   xlon = fspan(0.,357.5,144)

you're mixing latitude and longitude and/or use wrong dimension sizes.

   xlat = fspan(-90.,90,144)
   xlon = fspan(0.,357.5,288)

Bye,
Karin

Am 02.04.15 um 12:44 schrieb antonio avio:
> Hallo NCL,
> Im just wondering why the output of the interpolation filed are 
> missing in the last latitude (south and north poles: 87.5-90). The 
> input data is bellow:
>
> netcdf MERRA.U.1979.plev {
> dimensions:
>         time = 365 ;
>         levels = 42 ;
>         latitude = 144 ;
>         longitude = 288 ;
> variables:
>         float U(time, levels, latitude, longitude) ;
>                 U:long_name = "Eastward wind component" ;
>                 U:_FillValue = 1.e+15f ;
>                 U:comments = "Unknown1 variable comment" ;
>                 U:grid_name = "grid-1" ;
>                 U:time_statistic = "average" ;
>         double time(time) ;
>                 time:standard_name = "time" ;
>                 time:units = "hours since 1979-01-01 12:00:00" ;
>                 time:calendar = "standard" ;
>         double levels(levels) ;
>                 levels:standard_name = "air_pressure" ;
>                 levels:long_name = "Level" ;
>                 levels:units = "hPa" ;
>                 levels:positive = "down" ;
>                 levels:axis = "Z" ;
>         double latitude(latitude) ;
>                 latitude:standard_name = "latitude" ;
>                 latitude:long_name = "Latitude" ;
>                 latitude:units = "degrees_north" ;
>                 latitude:axis = "Y" ;
>         double longitude(longitude) ;
>                 longitude:standard_name = "longitude" ;
>                 longitude:long_name = "Longitude" ;
>                 longitude:units = "degrees_east" ;
>                 longitude:axis = "X" ;
>
>
> My script is:
>
> oad "$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"
>
> begin
>
> ;===========2.5x2.5=============
>
>   xlat = fspan(-90.,90,73)
>   xlon = fspan(0.,357.5,144)
>   xlat at units = "degrees_north"
>   xlon at units = "degrees_east"
>
> ;===============================
>
> do y =1979,1979
>   print(y)
>
>   f  = addfile ("MERRA.U."+y+".plev.nc <http://plev.nc>" , "r")
>
>     u   = f->U
>     u   = lonFlip(u)
>
> printVarSummary(u)
>
> print("=====================Process=========================")
>
>   U = linint2(u&longitude,u&latitude,u,True,xlon,xlat,0)
>
>
>   U!0   = "time"
>   U!1   = "level"
>   U!2   = "lat"
>   U!3   = "lon"
>   U&lat = xlat
>   U&lon = xlon
>   U&time  = u&time
>   U&level = u&levels
>
> printVarSummary(U)
>
> Thank you
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   meier-fleischer at dkrz.de
URL:      www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150402/90b41c39/attachment.html 


More information about the ncl-talk mailing list