# Re: first day

From: Michael Notaro <mnotaro_at_nyahnyahspammersnyahnyah>
Date: Fri, 01 May 2009 10:06:53 -0500

Thank you all for your suggestions. The following worked:

do ilat=0,47
do ilon=0,61
ii=ind(maxt(ilat,ilon,:).ge.10.)
firstmod(ilat,ilon,im,iy)=ii(0)
delete(ii)
end do
end do

On Apr 30, 2009, at 6:16 PM, Dennis Shea wrote:

> whobbs_at_ucla.edu wrote:
>> Mike
>>
>> This is just my suggestion, there may be a more elegant way
>> without the loops.
>>
>>
>> begin
>>
>> time = temp&time
>> firstday = new((/nlat, nlon/) typeof(time))
>>
>> do y = 0, nlat-1
>> do x = 0, nlon-1
>>
>> ii = ind(temp(y,x,:).ge.50.)
>>
>> if (not(all(ismissing(ii)) then
>>
> if (.not.ismissing(ii(0))) then ; fewer
> operations
>> firstday(y,x) = time( min(ii) )
>>
> firstday(y,x) = time( ii(0) ) ; no 'min' ii
> (0) is the 1st
>> end if
>> delete(ii)
>>
>> end do
>> end do
>>
>> end
>>
>> If the 'time' coords are not in a date format (e.g. 'hours since
>> 01-01-00' or something) then you can use 'ut_calender()' to
>> convert to the date format you want.
>>
>> Hope that helps
>>
>> Will
>>
>>
>> Quoting Michael Notaro <mnotaro_at_wisc.edu>:
>>
>>
>>> If I have a variable temp(lat,lon,time), where temp is the daily
>>> temperature for one year,
>>> what's an easy way to find firstday(lat,lon), where firstday is the
>>> first day with a temperature
>>> of at least 50F?
>>>
>>> Thanks, Mike
>>> _______________________________________________
>>> 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
>>
>
>
> --
> ======================================================
> Dennis J. Shea tel: 303-497-1361 |
> P.O. Box 3000 fax: 303-497-1333 |
> Climate Analysis Section |
> Climate & Global Dynamics Div. |
> National Center for Atmospheric Research |
> Boulder, CO 80307 |
> USA email: shea 'at' ucar.edu |
> ======================================================
>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri May 01 2009 - 09:06:53 MDT

This archive was generated by hypermail 2.2.0 : Fri May 01 2009 - 15:10:00 MDT