Re: average with irregular grid

From: <shea_at_nyahnyahspammersnyahnyah>
Date: Mon Sep 13 2010 - 18:08:09 MDT

The functions you used are only applicable to rectilinear grids.

When you say "irregualr grid", to what are you referring.
EG: a gaussian grid is rectilinear grid, bur irregularly spaced
in longitude.

The (say) POP grid is irregular. There the output netCDF files
contain the area of each grid cell and the appropriate depth

        float TAREA(nlat, nlon) ;
                TAREA:long_name = "area of T cells" ;
                TAREA:units = "centimeter^2" ;
                TAREA:coordinates = "TLONG TLAT" ;
                TAREA:_FillValue = 9.96921e+36f ;
                TAREA:missing_value = 9.96921e+36f ;

Here you could aclaulate the areal average via

x(nlat,nlon)

    xAvg = sum(TAREA*x)/sum(TAREA)

x(time,nlat,nlon)

    xAvg = new ( ntim, typeof(x), getFillValue(x))
    tarea_sum = sum(TAREA)
    do nt=0,ntim-1
       xAvg(nt) = sum(TAREA*x(nt,:,:))/tarea_sum
    end do

etc
========
If the elemental areas are not available, you will have to calculate.

Good luck

> Hi all,
>
> I have problem to calculate global temperature with irregular grid. The
> lon and lat is not even and also the depth is not even as well.
>
> I try to wgt_areaave_Wrap, wgt_areaave2, and still couldn't give me
> correct answer.
>
> Any suggestion or example I could follow.
>
> Mnay thanks,
>
> Arnold
>
>
> _______________________________________________
> 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 Sep 13 17:08:13 2010

This archive was generated by hypermail 2.1.8 : Thu Sep 16 2010 - 11:05:24 MDT