NCAR
view release on metacpan or search on metacpan
test/stex02.t view on Meta::CPAN
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
# change 'tests => 1' to 'tests => last_test_to_print';
use Test;
BEGIN { plan tests => 1 };
use NCAR;
ok(1); # If we made it this far, we're ok.;
#########################
# Insert your test code below, the Test module is use()ed here so read
# its man page ( perldoc Test ) for help writing this test script.
unlink( 'gmeta' );
use PDL;
use NCAR::Test qw( bndary gendat drawcl );
use strict;
&NCAR::gopks( 6, 1 );
&NCAR::gopwk( 1, 2, 1 );
&NCAR::gacwk( 1 );
#
# $Id: stex02.f,v 1.6 1995/06/14 13:57:12 haley Exp $
#
# Example STEX02 demonstrates how both the field flow utilities -
# Vectors and Streamlines - map into the non-uniform coordinate
# systems supported by the NCAR Graphics SET call. Each of the
# five frames display a uniform 45 degree field using a Streamlines
# representation overlaying a Vectors representation. The first four
# frames cycle through all possible settings of the Linear-Log (LL)
# argument to the SET call. The fifth frame shows a user coordinate
# system where the unit X is twice the size of the unit Y.
#
# The example also illustrates use of the compatibility mode parameter
# to allow use of the older interfaces (VELVCT and STRMLN), while
# still accessing post-Version 3.2 capabilities of the field flow
# utilities. Note that use of the old entry-points is discouraged
# other than on a transitional basis. Therefore the comments show the
# code required to create an identical plot using the Version 3.2
# interfaces.
#
my ( $M, $N ) = ( 25, 25 );
my $U = zeroes float, $N, $M;
my $V = zeroes float, $N, $M;
my $WRK = zeroes float, $M*$N*2;
#
# Specify the NDC coordinates for a plot title.
#
my ( $FX, $FY ) = ( 0.090909, 0.976540 );
#
# Specify VELVCT arguments.
#
my ( $FLO, $HI, $NSET, $LENGTH, $ISPV, $SPV ) = ( 0 ) x 6;
#
# Initialize the error parameter.
#
my $IERROR = 1;
#
# Specify velocity field component arrays U and V.
#
for my $I ( 1 .. $M ) {
for my $J ( 1 .. $N ) {
set( $U, $J-1, $I-1, 1 );
set( $V, $J-1, $I-1, 1 );
}
}
#
# Generate five frames:
# Frame 1: X-Axis linear, Y-Axis linear, equal units
# Frame 2: X-Axis linear, Y-Axis log
# Frame 3: X-Axis log, Y-Axis linear
# Frame 4: X-Axis log, Y-Axis log
# Frame 5: X-Axis linear, Y-Axis linear, 1 X unit = 2 Y units
#
for my $I ( 1 .. 5 ) {
#
my ( $XMX, $LL );
if( $I == 5 ) {
$XMX=50.0;
$LL=1;
} else {
$XMX=100.0;
$LL=$I;
}
#
# Set up the user coordinate system and the data coordinate
# boundaries.
#
&NCAR::set(0.05,0.95,0.05,0.95,1.0,$XMX,1.0,100.0,$LL);
( run in 1.391 second using v1.01-cache-2.11-cpan-39bf76dae61 )