From: <and...@us...> - 2011-10-19 23:26:30
|
Revision: 11984 http://plplot.svn.sourceforge.net/plplot/?rev=11984&view=rev Author: andrewross Date: 2011-10-19 23:26:23 +0000 (Wed, 19 Oct 2011) Log Message: ----------- Update fortran 95 examples style to remove obsolete syntax and make use of some f95 features. Fixes compiler warnings. Modified Paths: -------------- trunk/examples/f95/x02f.f90 trunk/examples/f95/x03f.f90 trunk/examples/f95/x06f.f90 trunk/examples/f95/x07f.f90 trunk/examples/f95/x08f.f90 trunk/examples/f95/x09f.f90 trunk/examples/f95/x11f.f90 trunk/examples/f95/x12f.f90 trunk/examples/f95/x13f.f90 trunk/examples/f95/x14f.f90 trunk/examples/f95/x15f.f90 trunk/examples/f95/x16af.f90 trunk/examples/f95/x16f.f90 trunk/examples/f95/x17f.f90 trunk/examples/f95/x18f.f90 trunk/examples/f95/x19f.f90 trunk/examples/f95/x20f.f90 trunk/examples/f95/x21f.f90 trunk/examples/f95/x23f.f90 trunk/examples/f95/x24f.f90 trunk/examples/f95/x26f.f90 trunk/examples/f95/x31f.f90 Modified: trunk/examples/f95/x02f.f90 =================================================================== --- trunk/examples/f95/x02f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x02f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -121,10 +121,10 @@ subroutine draw_windows( nw, cmap0_offset ) use plplot implicit none - integer nw, cmap0_offset - integer i,j - real(kind=plflt) vmin, vmax - character*3 text + integer :: nw, cmap0_offset + integer :: i,j + real(kind=plflt) :: vmin, vmax + character (len=3) :: text call plschr(0.0_plflt, 3.5_plflt) Modified: trunk/examples/f95/x03f.f90 =================================================================== --- trunk/examples/f95/x03f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x03f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -22,10 +22,10 @@ use plplot, PI => PL_PI implicit none - character*3 text - real(kind=plflt) x0(0:360), y0(0:360) - real(kind=plflt) x(0:360), y(0:360), dtr, theta, dx, dy, r, offset - integer i, nsp + character (len=3) :: text + real(kind=plflt), dimension(0:360) :: x0, y0, x, y + real(kind=plflt) :: dtr, theta, dx, dy, r, offset + integer :: i, nsp ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x06f.f90 =================================================================== --- trunk/examples/f95/x06f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x06f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -21,10 +21,10 @@ use plplot implicit none - integer i, j, k, font, kind_font, maxfont + integer :: i, j, k, font, kind_font, maxfont real(kind=plflt), dimension(1:1) :: x, y - character*3 text + character (len=3) :: text ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x07f.f90 =================================================================== --- trunk/examples/f95/x07f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x07f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -22,7 +22,7 @@ use plplot implicit none - character*4 text + character (len=4) :: text integer i, j, k, l, base(20) data base / & Modified: trunk/examples/f95/x08f.f90 =================================================================== --- trunk/examples/f95/x08f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x08f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -27,7 +27,7 @@ parameter (xdim=99, ydim=100, xpts=35, ypts=46) real(kind=plflt) x(xdim), y(ydim), z(xdim,ypts), xx, yy, r - character*80 title(2) + character (len=80) title(2) real(kind=plflt) alt(2),az(2) data alt /60.0_plflt,20.0_plflt/ data az /30.0_plflt,60.0_plflt/ Modified: trunk/examples/f95/x09f.f90 =================================================================== --- trunk/examples/f95/x09f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x09f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -201,7 +201,7 @@ real(kind=plflt) xg(xdim, ydim+1), yg(xdim, ydim+1), xtm(NPLT), ytm(NPLT) real(kind=plflt) clevel(20) - character*8 xopt, yopt + character(len=8) xopt, yopt nx = NCX ny = NCY Modified: trunk/examples/f95/x11f.f90 =================================================================== --- trunk/examples/f95/x11f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x11f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -26,7 +26,7 @@ real(kind=plflt) x(xpts), y(ypts), z(xpts,ypts), xx, yy - character*80 title(2) + character(len=80) title(2) real(kind=plflt) alt(2),az(2) integer opt(2) data alt /33.0_plflt,17.0_plflt/ Modified: trunk/examples/f95/x12f.f90 =================================================================== --- trunk/examples/f95/x12f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x12f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -22,10 +22,10 @@ use plplot implicit none - character*20 string - integer i - real(kind=plflt) y0(10) - real(kind=plflt) pos(5), red(5), green(5), blue(5) + character(len=20) :: string + integer :: i + real(kind=plflt) :: y0(10) + real(kind=plflt) :: pos(5), red(5), green(5), blue(5) data pos /0.0_plflt, 0.25_plflt, 0.5_plflt, 0.75_plflt, 1.0_plflt/ data red /0.0_plflt, 0.25_plflt, 0.5_plflt, 1.0_plflt, 1.0_plflt/ Modified: trunk/examples/f95/x13f.f90 =================================================================== --- trunk/examples/f95/x13f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x13f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -23,7 +23,7 @@ implicit none real(kind=plflt) just, dx, dy, x(500), y(500), per(5) integer i, j, dthet, theta0, theta1, theta - character*20 text(5) + character(len=20),dimension(5) :: text data text / 'Maurice', 'Geoffrey', 'Alan', 'Rafael', 'Vince'/ ! Process command-line arguments Modified: trunk/examples/f95/x14f.f90 =================================================================== --- trunk/examples/f95/x14f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x14f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -30,19 +30,19 @@ integer digmax - character*80 driver - character*15 geometry_master - character*15 geometry_slave + character(len=80) :: driver + character(len=15) :: geometry_master + character(len=15) :: geometry_slave - integer fam, num, bmax + integer :: fam, num, bmax - real(kind=plflt) x(101), y(101) - real(kind=plflt) xs(6), ys(6) - real(kind=plflt) xscale, yscale, xoff, yoff + real(kind=plflt), dimension(101) :: x, y + real(kind=plflt), dimension(6) :: xs, ys + real(kind=plflt) :: xscale, yscale, xoff, yoff common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff - real(kind=plflt) xp0, yp0 - integer xleng0, yleng0, xoff0, yoff0 - logical valid_geometry + real(kind=plflt) :: xp0, yp0 + integer :: xleng0, yleng0, xoff0, yoff0 + logical :: valid_geometry geometry_master = '500x410+100+200' geometry_slave = '500x410+650+200' @@ -164,11 +164,10 @@ use plplot implicit none - real(kind=plflt) x(101), y(101) - real(kind=plflt) xs(6), ys(6) - real(kind=plflt) xscale, yscale, xoff, yoff, & - xmin, xmax, ymin, ymax - integer i + real(kind=plflt), dimension(101) :: x, y + real(kind=plflt), dimension(6) :: xs, ys + real(kind=plflt) :: xscale, yscale, xoff, yoff, xmin, xmax, ymin, ymax + integer :: i common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff do i = 1, 60 @@ -213,10 +212,10 @@ subroutine plot2() use plplot implicit none - real(kind=plflt) x(101), y(101) - real(kind=plflt) xs(6), ys(6) - real(kind=plflt) xscale, yscale, xoff, yoff - integer i + real(kind=plflt), dimension(101) :: x, y + real(kind=plflt), dimension(6) :: xs, ys + real(kind=plflt) :: xscale, yscale, xoff, yoff + integer :: i common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff !====================================================================== @@ -255,10 +254,10 @@ use plplot, PI => PL_PI implicit none - real(kind=plflt) x(101), y(101) - real(kind=plflt) xs(6), ys(6) - real(kind=plflt) xscale, yscale, xoff, yoff - integer i + real(kind=plflt), dimension(101) :: x, y + real(kind=plflt), dimension(6) :: xs, ys + real(kind=plflt) :: xscale, yscale, xoff, yoff + integer :: i common /plotdat/ x, y, xs, ys, xscale, yscale, xoff, yoff call pladv(0) @@ -301,10 +300,10 @@ use plplot, PI => PL_PI implicit none - character*3 text - real(kind=plflt) x0(0:360), y0(0:360) - real(kind=plflt) x(0:360), y(0:360), dtr, theta, dx, dy, r - integer i, j, nsp + character(len=3) :: text + real(kind=plflt), dimension(0:360) :: x0, y0, x, y + real(kind=plflt) :: dtr, theta, dx, dy, r + integer :: i, j, nsp dtr = PI/180.0_plflt do i=0,360 @@ -391,17 +390,18 @@ use plplot, PI => PL_PI implicit none - integer i, j, nptsx, nptsy, xdim, ydim + integer :: i, j, nptsx, nptsy, xdim, ydim ! xdim and ydim are the absolute static dimensions. ! nptsx, and nptsy are the (potentially dynamic) defined area of the 2D ! arrays that is actually used. parameter (xdim=99, ydim=100, nptsx=35,nptsy=46) - real(kind=plflt) z(xdim, ydim), w(xdim, ydim), clevel(11), & - xg1(xdim), yg1(ydim), & - xg2(xdim, ydim), yg2(xdim, ydim) - real(kind=plflt) xx, yy, argx, argy, distort - real(kind=plflt) tr(6) + real(kind=plflt), dimension(xdim,ydim) :: z, w, xg2, yg2 + real(kind=plflt), dimension(11) :: clevel + real(kind=plflt), dimension(xdim) :: xg1 + real(kind=plflt), dimension(ydim) :: yg1 + real(kind=plflt) :: xx, yy, argx, argy, distort + real(kind=plflt), dimension(6) :: tr data clevel /-1._plflt, -0.8_plflt, -0.6_plflt, -0.4_plflt, & -0.2_plflt, & Modified: trunk/examples/f95/x15f.f90 =================================================================== --- trunk/examples/f95/x15f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x15f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -158,7 +158,7 @@ integer xdim, XPTS, YPTS real(kind=plflt) z(xdim,YPTS), zmin, zmax - character*1 undefined + character(len=1) undefined real(kind=plflt) shade_min, shade_max, sh_color integer sh_cmap, sh_width integer min_color, min_width, max_color, max_width @@ -214,7 +214,7 @@ integer xdim, XPTS, YPTS real(kind=plflt) z(xdim,YPTS), zmin, zmax - character*1 undefined + character(len=1) undefined real(kind=plflt) shade_min, shade_max, sh_color integer sh_cmap, sh_width integer min_color, min_width, max_color, max_width Modified: trunk/examples/f95/x16af.f90 =================================================================== --- trunk/examples/f95/x16af.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x16af.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -147,7 +147,7 @@ integer i, j, kx, lx, ky, ly integer sh_cmap, sh_width integer min_color, min_width, max_color, max_width - character*8 xopt, yopt + character(len=8) xopt, yopt ! Set up for plshade call Modified: trunk/examples/f95/x16f.f90 =================================================================== --- trunk/examples/f95/x16f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x16f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -36,7 +36,7 @@ integer fill_width, cont_color, cont_width integer i, j ! dummy to fill argument list with something not currently used. - character*1 defined + character(len=1) defined real(kind=plflt) tr(6) ! Process command-line arguments Modified: trunk/examples/f95/x17f.f90 =================================================================== --- trunk/examples/f95/x17f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x17f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -32,10 +32,10 @@ real(kind=plflt) y1, y2, y3, y4, ymin, ymax, xlab, ylab real(kind=plflt) t, tmin, tmax, tjump, dt, noise integer colbox, collab, colline(4), styline(4) - character*20 legline(4) + character(len=20) legline(4) logical pl_errcode - character*80 errmsg + character(len=80) errmsg ! Process command-line arguments call plparseopts(PL_PARSE_FULL) Modified: trunk/examples/f95/x18f.f90 =================================================================== --- trunk/examples/f95/x18f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x18f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -33,9 +33,8 @@ parameter ( NPTS = 1000 ) integer i, k - real(kind=plflt) x(NPTS), y(NPTS), z(NPTS) - real(kind=plflt) r - character*80 title + real(kind=plflt), dimension(NPTS) :: x, y, z, r + character(len=80) title integer opt(4) real(kind=plflt) alt(4) @@ -44,6 +43,8 @@ data alt / 20.0_plflt, 35.0_plflt, 50.0_plflt, 65.0_plflt / data az / 30.0_plflt, 40.0_plflt, 50.0_plflt, 60.0_plflt / + integer, dimension(NPTS) :: ia = (/(i,i=1,NPTS)/) + ! Process command-line arguments call plparseopts(PL_PARSE_FULL) @@ -55,19 +56,17 @@ call test_poly(k, alt(k), az(k)) enddo -! From the mind of a sick and twisted physicist... +! From the mind of a sick and twisted physicist... - do i = 1,NPTS - z(i) = -1._plflt + 2._plflt * dble (i-1) / dble (NPTS) + z = -1._plflt + 2._plflt * dble (ia-1) / dble (NPTS) -! Pick one ... +! Pick one ... -! r = 1. - dble (i-1) / dble (NPTS) - r = z(i) +! r = 1. - dble (ia-1) / dble (NPTS) + r = z - x(i) = r * cos( 2._plflt * PI * 6._plflt * dble (i-1) / dble (NPTS) ) - y(i) = r * sin( 2._plflt * PI * 6._plflt * dble (i-1) / dble (NPTS) ) - enddo + x = r * cos( 2._plflt * PI * 6._plflt * dble (ia-1) / dble (NPTS) ) + y = r * sin( 2._plflt * PI * 6._plflt * dble (ia-1) / dble (NPTS) ) do k = 1, 4 call pladv(0) @@ -116,10 +115,10 @@ .true., .false., .true., .false., & .false., .true., .false., .true., & .true., .true., .false., .false. / - real(kind=plflt) theta, phi - integer ia - THETA(ia) = (TWOPI * (ia) /20._plflt) - PHI(ia) = (PI * (ia) / 20.1_plflt) + integer, dimension(0:20) :: ia = (/(j,j=0,20)/) + real(kind=plflt), dimension(0:20) :: theta, phi + theta = TWOPI * ia /20._plflt + phi = PI * ia / 20.1_plflt call pladv(0) call plvpor(0.0_plflt, 1.0_plflt, 0.0_plflt, 0.9_plflt) @@ -143,25 +142,25 @@ do i=0,19 do j=0,19 - x(1) = sin( PHI(j) ) * cos( THETA(i) ) - y(1) = sin( PHI(j) ) * sin( THETA(i) ) - z(1) = cos( PHI(j) ) + x(1) = sin( phi(j) ) * cos( theta(i) ) + y(1) = sin( phi(j) ) * sin( theta(i) ) + z(1) = cos( phi(j) ) - x(2) = sin( PHI(j+1) ) * cos( THETA(i) ) - y(2) = sin( PHI(j+1) ) * sin( THETA(i) ) - z(2) = cos( PHI(j+1) ) + x(2) = sin( phi(j+1) ) * cos( theta(i) ) + y(2) = sin( phi(j+1) ) * sin( theta(i) ) + z(2) = cos( phi(j+1) ) - x(3) = sin( PHI(j+1) ) * cos( THETA(i+1) ) - y(3) = sin( PHI(j+1) ) * sin( THETA(i+1) ) - z(3) = cos( PHI(j+1) ) + x(3) = sin( phi(j+1) ) * cos( theta(i+1) ) + y(3) = sin( phi(j+1) ) * sin( theta(i+1) ) + z(3) = cos( phi(j+1) ) - x(4) = sin( PHI(j) ) * cos( THETA(i+1) ) - y(4) = sin( PHI(j) ) * sin( THETA(i+1) ) - z(4) = cos( PHI(j) ) + x(4) = sin( phi(j) ) * cos( theta(i+1) ) + y(4) = sin( phi(j) ) * sin( theta(i+1) ) + z(4) = cos( phi(j) ) - x(5) = sin( PHI(j) ) * cos( THETA(i) ) - y(5) = sin( PHI(j) ) * sin( THETA(i) ) - z(5) = cos( PHI(j) ) + x(5) = sin( phi(j) ) * cos( theta(i) ) + y(5) = sin( phi(j) ) * sin( theta(i) ) + z(5) = cos( phi(j) ) call plpoly3(x, y, z, draw(:,k), .true.) enddo Modified: trunk/examples/f95/x19f.f90 =================================================================== --- trunk/examples/f95/x19f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x19f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -89,8 +89,8 @@ implicit none integer :: axis, length real(kind=plflt) :: value - character*(length) label - character*5 direction_label + character(len=length) label + character(len=5) direction_label real(kind=plflt) :: label_val = 0.0_plflt real(kind=plflt) :: normalize_longitude Modified: trunk/examples/f95/x20f.f90 =================================================================== --- trunk/examples/f95/x20f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x20f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -97,7 +97,7 @@ logical dbg logical nosombrero logical nointeractive - character*80 f_name + character(len=80) f_name ! ! Bugs in plimage(): @@ -304,7 +304,7 @@ implicit none integer bytes - character*8 string + character(len=8) string integer i integer ierr Modified: trunk/examples/f95/x21f.f90 =================================================================== --- trunk/examples/f95/x21f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x21f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -46,7 +46,7 @@ real(kind=plflt) zmin, zmax, lzmin, lzmax integer i, j, k integer alg - character*80 title(6) + character(len=80) title(6) data title /'Cubic Spline Approximation', & 'Delaunay Linear Interpolation', & 'Natural Neighbors Interpolation', & @@ -63,7 +63,7 @@ integer ii, jj real(kind=plflt) dist, d - character*1 defined + character(len=1) defined xmin = -0.2_plflt ymin = -0.2_plflt Modified: trunk/examples/f95/x23f.f90 =================================================================== --- trunk/examples/f95/x23f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x23f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -31,14 +31,14 @@ real(kind=plflt) xmin, xmax, ymin, ymax, ycharacter_scale, yoffset real(kind=plflt) chardef, charht, deltax, deltay, x, y integer i, j, page, length, slice - character*20 cmdString + character(len=20) cmdString integer(kind=plunicode) fci_old integer ifamily, istyle, iweight real(kind=plflt) dy integer family_index, style_index, weight_index ! Must be big enough to contain the prefix strings, the font-changing ! commands, and the "The quick brown..." string. - character*200 string + character(len=200) string @@ -48,18 +48,18 @@ integer fci_combinations parameter(fci_combinations = 30) - character*5 greek(48) + character(len=5) greek(48) integer type1(166) - character*80 title(11) + character(len=80) title(11) integer lo(11) integer hi(11) integer nxcells(11) integer nycells(11) integer offset(11) integer(kind=plunicode) :: fci(fci_combinations) - character*11 family(5) - character*8 style(3) - character*7 weight(2) + character(len=11) family(5) + character(len=8) style(3) + character(len=7) weight(2) data (greek(i) ,i=1,48) / & '#gA','#gB','#gG','#gD','#gE','#gZ', & Modified: trunk/examples/f95/x24f.f90 =================================================================== --- trunk/examples/f95/x24f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x24f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -59,7 +59,7 @@ real(kind=plflt) sx(12) real(kind=plflt) sy(12) - character*30 peace(12) + character(len=30) peace(12) data (red(i) ,i=1,7) / 240, 204, 204, 204, 0, 39, 125 / data (green(i) ,i=1,7) / 240, 0, 125, 204, 204, 80, 0 / Modified: trunk/examples/f95/x26f.f90 =================================================================== --- trunk/examples/f95/x26f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x26f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -77,12 +77,12 @@ integer, parameter :: nolangs = 2 integer, parameter :: nlegend = 2 - character*80 x_label(nolangs) - character*80 y_label(nolangs) - character*80 legend_text(2,nolangs) - character*80 alty_label(nolangs) - character*80 title_label(nolangs) - character*80 line_label(nolangs) + character(len=80) x_label(nolangs) + character(len=80) y_label(nolangs) + character(len=80) legend_text(2,nolangs) + character(len=80) alty_label(nolangs) + character(len=80) title_label(nolangs) + character(len=80) line_label(nolangs) integer i, j @@ -159,7 +159,7 @@ integer symbol_numbers(nlegend) integer symbol_colors(nlegend) real(kind=plflt) symbol_scales(nlegend) - character*20 symbols(nlegend) + character(len=20) symbols(nlegend) integer box_colors(0), box_patterns(0), box_line_widths(0) real(kind=plflt) box_scales(0) real(kind=plflt) legend_width, legend_height Modified: trunk/examples/f95/x31f.f90 =================================================================== --- trunk/examples/f95/x31f.f90 2011-10-19 22:46:13 UTC (rev 11983) +++ trunk/examples/f95/x31f.f90 2011-10-19 23:26:23 UTC (rev 11984) @@ -45,7 +45,7 @@ data b1 /0, 0/ real(kind=plflt) a1(2) data a1 /1.0_plflt, 1.0_plflt/ - character*256 fnam + character(len=256) fnam integer stderr integer status This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |