File: readflight.f

package info (click to toggle)
flextra 5.0-2.1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 860 kB
  • ctags: 402
  • sloc: fortran: 6,987; makefile: 55; sh: 17
file content (105 lines) | stat: -rw-r--r-- 4,371 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
      subroutine readflight(error)
C                             o
***********************************************************************
*                                                                     * 
*             TRAJECTORY MODEL SUBROUTINE READCET                     *
*                                                                     *
***********************************************************************
*                                                                     * 
*             AUTHOR:      A. STOHL                                   *
*             DATE:        1999-02-01                                 *
*                                                                     * 
* Update: Vertical coordinate can now be given in meters above sea    * 
* level, meters above ground, and in hPa.                             * 
*                                                                     * 
***********************************************************************
*                                                                     *
* DESCRIPTION:                                                        *
*                                                                     *
* READING OF TRAJECTORY STARTING/ENDING POINTS FROM DATA FILE         *
*                                                                     * 
* LINE                  a line of text                                * 
* NUMPOINT              number of trajectory starting/ending points   *
* XPOINT(maxpoint)      x-coordinates of starting/ending points       *
* YPOINT(maxpoint)      y-coordinates of starting/ending points       *
* ZPOINT(maxpoint)      z-coordinates of starting/ending points       *
* KINDZ(maxpoint)       kind of z coordinate (1:masl, 2:magl, 3:hPa)  *
* KIND(maxpoint)        kind of trajectory                            *
* COMPOINT(maxpoint)    comment for trajectory output                 *
*                                                                     *
***********************************************************************
*
      include 'includepar'
      include 'includecom'

      logical error
      integer ldat,ltim
      double precision juldate

      error=.false.

* Open file 'STARTFLIGHT'
*************************

      open(unitpoin,file=path(1)(1:len(1))//'STARTFLIGHT',
     +status='old',err=999)

      call skplin(27,unitpoin)
      read(unitpoin,'(a)',err=998,end=998) compoint(1)(1:40)
      read(unitpoin,*,err=998,end=998) kind(1)
      read(unitpoin,*,err=998,end=998) kindz(1)
      call skplin(1,unitpoin)

C Read the first starting point
*******************************

      read(unitpoin,*,err=998,end=998) ldat,ltim
      read(unitpoin,*,err=998,end=998) xpoint(1)
      read(unitpoin,*,err=998,end=998) ypoint(1)
      read(unitpoin,*,err=998,end=998) zpoint(1)
      call skplin(1,unitpoin)
      nextflight=nint(sngl(juldate(ldat,ltim)-bdate)*86400.)
      if (kindz(1).eq.3) zpoint(1)=zpoint(1)*100.

      numpoint=1

  
C Forbid mixing layer trajectories
**********************************

      if (kind(1).eq.3) then
        write(*,*) '### Mixing layer trajectories not allowed ###'
        write(*,*) '### for FLIGHT calculations. Select a     ###'
        write(*,*) '### different trajectory type!            ###'
        error=.true.
        return
      endif

      return

998   error=.true.
         write(*,*) '#### TRAJECTORY MODEL SUBROUTINE READFLIGHT: '//
     &              '#### '
         write(*,*) '#### FATAL ERROR - FILE "STARTFLIGHT" IS     '//
     &              '#### '
         write(*,*) '#### CORRUPT. PLEASE CHECK YOUR INPUTS FOR   '//
     &              '#### '
         write(*,*) '#### MISTAKES OR GET A NEW "STARTPOINTS"-    '//
     &              '#### '
         write(*,*) '#### FILE ...                                '//
     &              '#### '
      return

999   error=.true.
      write(*,*)  
      write(*,*) ' ###########################################'//
     &           '###### '
      write(*,*) '    TRAJECTORY MODEL SUBROUTINE READFLIGHT:'
      write(*,*)
      write(*,*) ' FATAL ERROR - FILE STARTFLIGHT IS NOT AVAILABLE'
      write(*,*) ' OR YOU ARE NOT PERMITTED FOR ANY ACCESS'
      write(*,*) ' ###########################################'//
     &           '###### '

      return
      end