>> I want do use ncl to do Kolmogorov-Smirnov Test or
>> Kuiper's Test, but I couldn't find these build-in test
>> functions, so I doubt whether there are these build-in
>> functions.
>
>One of the advantages of ncl is that it is easy to use
>your Fortran 77 subroutines.
>
><http://ngwww.ucar.edu/ngdoc/ng/ug/ncl/gsun/
>beyondbasics.html#IncorporateYourOwn>
================
==> [1] Yes, that is a major advantage of NCL. It is quite easy.
eg: if you have purchased the Numerical Recipes book
then type the routine or get one of the electronic versions.
[a] call the file KST.f
C NCLFORTSTART
subroutine kstwo (data1,n1,data2,n2,d,prob)
dimension data1(n1), data2(n2)
C NCLEND
[rest of code]
[b] WRAPIT KST.f
Note: WRAPIT understands fortrans default typing.
[c] In your NCL script
external KST "./KST.so" ; it could be in any directory
begin
:
x1
x2
dd = 0.
pr = 0.
KST::kstwo (x1, dimsizes(x1), x2, dimsizes(x2), dd, pr)
==========
[2] NCL can also be use shared objects from C and f90/f95 codes.
[A]
Say you have a f90 code (foo90.f90) that contains the following:
subroutine foo90 (arg1,arg2,arg3,n3)
implicit none
integer :: arg1, n3
real :: arg2
double, dimension(n3) :: arg3
....
return
end
NCL's WRAPIT does not 'understand' f90 syntax. The user
need only create a simple fortran 77 subroutine that
calls the f90 code.
C NCLFORTSTART
subroutine foo77 (arg1,arg2,arg3,n3)
integer arg1, n3
real arg2
double precision arg3(n3)
C NCLEND
call foo90 (arg1,arg2,arg3,n3)
return
end
[B]
WRAPIT -n foo foo77.f foo90.f90
[C] In your NCL script
external FOO "./foo.so" ; it could be in any directory
begin
:
FOO::foo77 (a1, a2, a3, n )
:
end
Regards,
Dennis Shea
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Sun Mar 16 2003 - 09:00:25 MST