load "$NCARGTEST/nclscripts/functions.ncl" external EX01 "./ex01.so" begin ; ; Calculate three values of a quadratic equation ; nump = 3 x = (/ -1., 0.0, 1.0 /) qval = new(nump,float,"No_FillValue") EX01::cquad(-1., 2., 3., nump, x, qval) ; Call the NCL version of ; your Fortran subroutine. check_values("cquad","qval",qval,(/0,3,4/),True,False,0) ; print("Polynomial values should be 0,3,4.") ; print("They are = " + qval) ; Should be (/0,3,4/) ; ; Calculate an arc length. ; xc = (/ 0., 1., 2. /) yc = (/ 0., 1., 0. /) arclen = EX01::arcln(nump,xc,yc) ; Call the NCL version of ; your Fortran function. check_values("arcln","arclen",arclen,2.828427,True,False,0) ; print("The arc length should be 2.82843.") ; print("It is actually " + arclen) ; should be 2.82843 end