# Re: separating data set base on lat/lon

From: Marcos Tonelli <marcos.tonelli_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 30 2013 - 13:17:10 MDT

Dear Setareh,

off the top of my head, I'd suggest you look for "Coordinate subscripts" in
the reference guide.

Have you checked the Mini-Language Manual as suggested by Dr. Shea? (
http://www.ncl.ucar.edu/Document/Manuals/language_man.pdf)

I truly believe you can find the answers to most of your questions there.
Besides that, all the reading and searching is part of the learning process.
Seriously, that's how every NCL user I know did it.

Good luck.

On Tue, Jul 30, 2013 at 3:49 PM, Setareh Rahimi <setareh.rahimi@gmail.com>wrote:

> Dear all,
>
> I am running codes to calculate standardised precipitation index (SPI). I
> need to calculate it for each continent, so I should separate my data set
> to different lat/lon. I am a new user of ncl and do not know how it is
> possible to do so.If any one knows how can I separate the data set please
> advice me to sort this issue out. Here is the codes I use.
>
>
> begin
>
> prc = f->preic
> yyyymm = f->time
> printVarSummary(prc)
> dimp = dimsizes(prc)
> ntim = dimp(0)
> nlat = dimp(1)
> mlon = dimp(2)
>
> len = (/3,6,12,24,36,48/)
> klen = dimsizes(len)
> spi = new((/klen,ntim,nlat,mlon/),float)
>
> do k=0,klen-1
> spi(k,:,:,:) = dim_spi_n(prc2, len(k), False, 0)
> end do
>
> print(yyyymm+sprintf("%8.2f", prc)\
> +sprintf("%8.2f", spi(0,:,:,:))+sprintf("%8.2f",
> spi(1,:,:,:))\
> +sprintf("%8.2f", spi(2,:,:,:))+sprintf("%8.2f",
> spi(3,:,:,:))\
> +sprintf("%8.2f", spi(4,:,:,:))+sprintf("%8.2f",
> spi(5,:,:,:)))
> end
>
>
>
> --
> S.Rahimi
>
>
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>

```--
____________________________________________
Marcos Tonelli
PhD Student
Physical Oceanography, Climate & Cryosphere Lab - OCē
Oceanographic Institute - University of Sao Paulo - Brazil
+55 11 3091 6582

```

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jul 30 13:17:27 2013

This archive was generated by hypermail 2.1.8 : Thu Aug 01 2013 - 15:55:03 MDT