[ncl-talk] problem with bilinear interpolation

antonio avio antonioavio at googlemail.com
Thu Apr 2 05:45:32 MDT 2015


I think I will fill the poles as follow:

   do nt=0,ntim-1
        do nl=0, mlev-1
         U(nt,nl,mlat-1,:) = dim_avg(U(nt,nl,mlat-2,:))  ; pole_nh
         U(nt,nl,   0  ,:) = dim_avg(U(nt,nl,   1  ,:))        ; pole_sh
        end do
    end do

but it's really coarse in the edge of the data.. no idea how to smooth it.

On Thu, Apr 2, 2015 at 1:41 PM, antonio avio <antonioavio at googlemail.com>
wrote:

> Hi Karin,
> What I wanted to do is to interpolate from 144x288 to 73x144.
> It works, but the edges of the data are missing esp. in the north and
> south poles.
> Thanks
>
> On Thu, Apr 2, 2015 at 12:56 PM, Karin Meier-Fleischer <
> meier-fleischer at dkrz.de> wrote:
>
>>  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" , "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
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150402/f9943498/attachment.html 


More information about the ncl-talk mailing list