<Example Program>
Program norm2_example Real :: x(5,3) Data x(:,1)/3.0e-30,2.0e-30,2.0e-30,2.0e-30,2.0e-30/ Data x(:,2)/3.0,2.0,2.0,2.0,2.0/ Data x(:,3)/3.0e+30,2.0e+30,2.0e+30,2.0e+30,2.0e+30/ Print 1, x 1 Format(1X,'Whole array X is ',/,3(5(2X,ES12.5),/)) Print 2, Norm2(x) 2 Format(1X,'Norm2 of (the whole of) X is ',ES12.5) Print 3, 1, Norm2(x,Dim=1) 3 Format(1X,'Norm2 with DIM=',I0,' is',99(1X,ES11.4,:)) Print 3, 2, Norm2(x,Dim=2) End Program |
|
![]() Whole array X is 3.00000E-30 2.00000E-30 2.00000E-30 2.00000E-30 2.00000E-30 3.00000E+00 2.00000E+00 2.00000E+00 2.00000E+00 2.00000E+00 3.00000E+30 2.00000E+30 2.00000E+30 2.00000E+30 2.00000E+30 Norm2 of (the whole of) X is 5.00000E+30 Norm2 with DIM=1 is 5.0000E-30 5.0000E+00 5.0000E+30 Norm2 with DIM=2 is 3.0000E+30 2.0000E+30 2.0000E+30 2.0000E+30 2.0000E+30 |