~ubuntu-branches/ubuntu/intrepid/plplot/intrepid

« back to all changes in this revision

Viewing changes to examples/f95/x19f.f90

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2006-11-04 10:19:34 UTC
  • mfrom: (2.1.8 edgy)
  • Revision ID: james.westby@ubuntu.com-20061104101934-mlirvdg4gpwi6i5q
Tags: 5.6.1-10
* Orphaning the package
* debian/control: Changed the maintainer to the Debian QA Group

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!      $Id: x19f.f90,v 1.1 2006/05/16 20:24:13 airwin Exp $
 
2
!
 
3
!      Copyright (C) 2004  Alan W. Irwin
 
4
!
 
5
!      This file is part of PLplot.
 
6
!
 
7
!      PLplot is free software; you can redistribute it and/or modify
 
8
!      it under the terms of the GNU General Library Public License as
 
9
!      published by the Free Software Foundation; either version 2 of the
 
10
!      License, or (at your option) any later version.
 
11
!
 
12
!      PLplot is distributed in the hope that it will be useful,
 
13
!      but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
!      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
!      GNU Library General Public License for more details.
 
16
!
 
17
!      You should have received a copy of the GNU Library General Public
 
18
!      License along with PLplot; if not, write to the Free Software
 
19
!      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
20
 
 
21
 
 
22
!--------------------------------------------------------------------------
 
23
! ident
 
24
!
 
25
! Defines identity transformation for example 19.
 
26
! x(), y() are the coordinates to be plotted.
 
27
! This is a 0-OP routine, to play the role of NULL in the C version!
 
28
!--------------------------------------------------------------------------
 
29
 
 
30
      subroutine ident(n, x, y)
 
31
      use plplot
 
32
      implicit none
 
33
 
 
34
      integer n
 
35
      real(kind=plflt)    x
 
36
      real(kind=plflt)    y
 
37
 
 
38
      return
 
39
      end
 
40
 
 
41
!--------------------------------------------------------------------------
 
42
! mapform19
 
43
!
 
44
! Defines specific coordinate transformation for example 19.
 
45
! Not to be confused with mapform in src/plmap.c.
 
46
! x(), y() are the coordinates to be plotted.
 
47
!--------------------------------------------------------------------------
 
48
 
 
49
      subroutine mapform19(n, x, y)
 
50
      use plplot, PI => PL_PI
 
51
      implicit none
 
52
 
 
53
      integer n
 
54
      real(kind=plflt)    x(n)
 
55
      real(kind=plflt)    y(n)
 
56
 
 
57
      integer i
 
58
      real(kind=plflt)    xp, yp, radius
 
59
 
 
60
      do i = 1,n
 
61
         radius = 90.0_plflt - y(i)
 
62
         xp = radius * cos(x(i) * PI / 180.0_plflt)
 
63
         yp = radius * sin(x(i) * PI / 180.0_plflt)
 
64
         x(i) = xp
 
65
         y(i) = yp
 
66
      enddo
 
67
      return
 
68
      end
 
69
 
 
70
!--------------------------------------------------------------------------
 
71
! main
 
72
!
 
73
! Shows two views of the world map.
 
74
!--------------------------------------------------------------------------
 
75
 
 
76
      program x19f
 
77
      use plplot
 
78
      implicit none
 
79
      real(kind=plflt)    minx, maxx, miny, maxy
 
80
      integer c
 
81
      external ident
 
82
      external mapform19
 
83
 
 
84
!      Process command-line arguments
 
85
      call plparseopts(PL_PARSE_FULL)
 
86
 
 
87
! Longitude (x) and latitude (y)
 
88
 
 
89
      miny = -70
 
90
      maxy = 80
 
91
 
 
92
      call plinit()
 
93
 
 
94
! Cartesian plots
 
95
! Most of world
 
96
 
 
97
      minx = 190
 
98
      maxx = 190+360
 
99
 
 
100
      call plcol0(1)
 
101
      call plenv(minx, maxx, miny, maxy, 1, -1)
 
102
      call plmap(ident, 'usaglobe', minx, maxx, miny, maxy)
 
103
 
 
104
! The Americas
 
105
 
 
106
      minx = 190
 
107
      maxx = 340
 
108
 
 
109
      call plcol0(1)
 
110
      call plenv(minx, maxx, miny, maxy, 1, -1)
 
111
      call plmap(ident, 'usaglobe', minx, maxx, miny, maxy)
 
112
 
 
113
! Polar, Northern hemisphere
 
114
 
 
115
      minx = 0
 
116
      maxx = 360
 
117
 
 
118
      call plenv(-75._plflt, 75._plflt, -75._plflt, &
 
119
              75._plflt, 1, -1)
 
120
      call plmap(mapform19,'globe', minx, maxx, miny, maxy)
 
121
 
 
122
      call pllsty(2)
 
123
      call plmeridians(mapform19,10.0_plflt, 10.0_plflt, &
 
124
              0.0_plflt, 360.0_plflt, -10.0_plflt, &
 
125
              80.0_plflt)
 
126
      call plend()
 
127
      end