source: flexpart.git/src/readpaths.f90 @ b7ae015

10.4.1_peseiFPv9.3.1FPv9.3.1b_testingFPv9.3.2GFS_025bugfixes+enhancementsdevfp9.3.1-20161214-nc4grib2nc4_repairrelease-10release-10.4.1scaling-bugunivie
Last change on this file since b7ae015 was b7ae015, checked in by Ignacio Pisso <Ignacio.Pisso@…>, 9 years ago

clean up runtime messages and adjust verbosity level

  • Property mode set to 100755
File size: 5.4 KB
Line 
1!**********************************************************************
2! Copyright 1998,1999,2000,2001,2002,2005,2007,2008,2009,2010         *
3! Andreas Stohl, Petra Seibert, A. Frank, Gerhard Wotawa,             *
4! Caroline Forster, Sabine Eckhardt, John Burkhart, Harald Sodemann   *
5!                                                                     *
6! This file is part of FLEXPART.                                      *
7!                                                                     *
8! FLEXPART is free software: you can redistribute it and/or modify    *
9! it under the terms of the GNU General Public License as published by*
10! the Free Software Foundation, either version 3 of the License, or   *
11! (at your option) any later version.                                 *
12!                                                                     *
13! FLEXPART is distributed in the hope that it will be useful,         *
14! but WITHOUT ANY WARRANTY; without even the implied warranty of      *
15! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *
16! GNU General Public License for more details.                        *
17!                                                                     *
18! You should have received a copy of the GNU General Public License   *
19! along with FLEXPART.  If not, see <http://www.gnu.org/licenses/>.   *
20!**********************************************************************
21
22subroutine readpaths !(pathfile)
23
24  !*****************************************************************************
25  !                                                                            *
26  !     Reads the pathnames, where input/output files are expected to be.      *
27  !     The file pathnames must be available in the current working directory. *
28  !                                                                            *
29  !     Author: A. Stohl                                                       *
30  !                                                                            *
31  !     1 February 1994                                                        *
32  !     last modified                                                          *
33  !     HS, 7.9.2012                                                           *
34  !     option to give pathnames file as command line option                   *
35  !                                                                            *
36  !*****************************************************************************
37  !                                                                            *
38  ! Variables:                                                                 *
39  ! length(numpath)    lengths of the path names                               *
40  ! path(numpath)      pathnames of input/output files                         *
41  !                                                                            *
42  ! Constants:                                                                 *
43  ! numpath            number of pathnames to be read in                       *
44  !                                                                            *
45  !*****************************************************************************
46
47  use par_mod
48  use com_mod
49
50  implicit none
51
52  integer   :: i
53  character(256) :: string_test
54  character(1) :: character_test
55
56  ! Read the pathname information stored in unitpath
57  !*************************************************
58
59  open(unitpath,file=trim(pathfile),status='old',err=999)
60
61  do i=1,numpath
62    read(unitpath,'(a)',err=998) path(i)
63    length(i)=index(path(i),' ')-1
64
65
66  if (verbosity.gt.0) then
67      print*, 'path read', i, '=',  trim(path(i))
68  end if
69   
70  end do
71
72
73    do i=1,numpath
74    string_test = path(i)
75    character_test = string_test(length(i):length(i))
76    ! print*, 'character_test,  string_test ', character_test,  string_test
77    ! include nested fields
78      if ((character_test .NE. '/') .AND. ((i .LT. 4) .OR. (i .EQ. 5) ))  then
79         if (verbosity.gt.0) then
80         print*, 'readpaths> WARNING: path not ending in /'
81         print*, path(i)
82         endif
83         path(i) = string_test(1:length(i)) // '/'
84         length(i)=length(i)+1
85         if (verbosity.gt.0) then
86         print*, 'fix: padded with /'
87         print*, path(i)
88         print*, 'length(i) increased 1',  length(i)
89         endif
90      endif
91    end do
92
93
94
95  ! Check whether any nested subdomains are to be used
96  !***************************************************
97
98  do i=1,maxnests
99    read(unitpath,'(a)') path(numpath+2*(i-1)+1)
100    read(unitpath,'(a)') path(numpath+2*(i-1)+2)
101    if (path(numpath+2*(i-1)+1)(1:5).eq.'=====') goto 30
102    length(numpath+2*(i-1)+1)=index(path(numpath+2*(i-1)+1),' ')-1
103    length(numpath+2*(i-1)+2)=index(path(numpath+2*(i-1)+2),' ')-1
104  end do
105
106
107  ! Determine number of available nested domains
108  !*********************************************
109
11030   numbnests=i-1
111
112  !if (verbosity.gt.0) then
113  !    do i=1,numpath
114  !    print*, 'path tested', i, '=',  path(i)
115  !    end do
116  !end if
117
118  close(unitpath)
119  return
120
121   
122
123
124998   write(*,*) ' #### TRAJECTORY MODEL ERROR! ERROR WHILE     #### '
125  write(*,*) ' #### READING FILE PATHNAMES.                 #### '
126  stop
127
128999   write(*,*) ' #### TRAJECTORY MODEL ERROR! FILE "pathnames"#### '
129  write(*,*) ' #### CANNOT BE OPENED IN THE CURRENT WORKING #### '
130  write(*,*) ' #### DIRECTORY.                              #### '
131  stop
132
133end subroutine readpaths
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG