source: flexpart.git/src/readpaths.f90 @ 5f2e8f6

flexpart-noresm
Last change on this file since 5f2e8f6 was 5f2e8f6, checked in by Ignacio Pisso <Ignacio.Pisso@…>, 8 years ago

new flexpart noresm code in src

  • Property mode set to 100755
File size: 4.5 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
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  !                                                                            *
33  !*****************************************************************************
34  !                                                                            *
35  ! Variables:                                                                 *
36  ! length(numpath)    lengths of the path names                               *
37  ! path(numpath)      pathnames of input/output files                         *
38  !                                                                            *
39  ! Constants:                                                                 *
40  ! numpath            number of pathnames to be read in                       *
41  !                                                                            *
42  !*****************************************************************************
43
44  use par_mod
45  use com_mod
46
47  implicit none
48
49  integer :: i
50
51  ! Read the pathname information stored in unitpath
52  !*************************************************
53
54
55  open(unitpath,file='pathnames',status='old',err=999)
56
57  do i=1,numpath
58    read(unitpath,'(a)',err=998) path(i)
59    length(i)=index(path(i),' ')-1
60  end do
61
62  ! Check whether any nested subdomains are to be used
63  !***************************************************
64
65  do i=1,maxnests
66    read(unitpath,'(a)') path(numpath+2*(i-1)+1)
67    read(unitpath,'(a)') path(numpath+2*(i-1)+2)
68    if (path(numpath+2*(i-1)+1)(1:5).eq.'=====') goto 30
69    length(numpath+2*(i-1)+1)=index(path(numpath+2*(i-1)+1),' ')-1
70    length(numpath+2*(i-1)+2)=index(path(numpath+2*(i-1)+2),' ')-1
71  end do
72
73
74  ! Determine number of available nested domains
75  !*********************************************
76
7730   numbnests=i-1
78     
79     if (numbnests.ne.0) then
80         write(*,*) ' #### TRAJECTORY MODEL ERROR! ERROR WHILE     #### '
81         write(*,*) ' #### READING FILE PATHNAMES.                 #### '
82         write(*,*) ' #### NORESM version, NO NESTED INPUT         #### '
83         write(*,*) ' #### SUBDOMAIN ALLOWED                       #### '
84     stop
85     end if
86
87  close(unitpath)
88  return
89
90998   write(*,*) ' #### TRAJECTORY MODEL ERROR! ERROR WHILE     #### '
91  write(*,*) ' #### READING FILE PATHNAMES.                 #### '
92  stop
93
94999   write(*,*) ' #### TRAJECTORY MODEL ERROR! FILE "pathnames"#### '
95  write(*,*) ' #### CANNOT BE OPENED IN THE CURRENT WORKING #### '
96  write(*,*) ' #### DIRECTORY.                              #### '
97  stop
98
99end subroutine readpaths
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG