P1 = (P1 - P2) * (P3/P4)
would imply a one line array operation which would certainly be faster
than looping. Array operations require array conformance.
However, the 12, 365 and 2930 do not seem to be amenable to
any application of the 'conform' or 'conform_dims' function,
I do not see any alternative to looping.
I would suggest using a shared object aloysius.f
C NCLFORTSTART
subroutine noel(nhr,ndy,nmo,nlat,mlon,p1,p2,p3,p4)
implicit none
integer nhr,ndy,nmo,nlat,mlon
real p1(mlon,nlat,nhr), p2(mlon,nlat,ndy),
+ p3(mlon,nlat,nmo), p4(mlon,nlat,nmo)
C NCLEND
... code ...
return
end
======
WRAPIT aloysius.f
======
external LOOP "./aloysius.so"
:
LOOP::noel(nhr,ndy,nmo,nlat,mlon,p1,p2,p3,p4)
On 11/6/12 10:23 AM, Noel Aloysius wrote:
> Hi NCL-talk,
>
> I have four arrays as follows
>
> (i) 3-hourly P1(/2930,180,360/)
> (ii) daily P2(/365,180,360/)
> (iii) monthly P3(/12,180,360/) and P4(/12,180,360/)
>
> I want to perform the following calculation,
>
> P1 = (P1 - P2) * (P3/P4)
>
> I can do this within a do loop with the P1 array time steps. I would
> like to know if I could do this as a series of array operations with
> minimum do-loops.
>
> I would appreciate any direction you could provide.
>
> Thanks,
> Noel
>
>
>
> Noel Aloysius
>
>
> _______________________________________________
> 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 Wed Nov 7 07:39:28 2012
This archive was generated by hypermail 2.1.8 : Tue Nov 13 2012 - 14:27:24 MST