source: flexpart.git/src/readpaths.f90 @ 3481cc1

10.4.1_peseiGFS_025bugfixes+enhancementsdevrelease-10release-10.4.1scaling-bug
Last change on this file since 3481cc1 was 3481cc1, checked in by Ignacio Pisso <ip@…>, 4 years ago

move license from headers to a different file

  • Property mode set to 100644
File size: 3.7 KB
Line 
1subroutine readpaths
2
3  !*****************************************************************************
4  !                                                                            *
5  !     Reads the pathnames, where input/output files are expected to be.      *
6  !     The file pathnames must be available in the current working directory. *
7  !                                                                            *
8  !     Author: A. Stohl                                                       *
9  !                                                                            *
10  !     1 February 1994                                                        *
11  !     last modified                                                          *
12  !     HS, 7.9.2012                                                           *
13  !     option to give pathnames file as command line option                   *
14  !                                                                            *
15  !*****************************************************************************
16  !                                                                            *
17  ! Variables:                                                                 *
18  ! length(numpath)    lengths of the path names                               *
19  ! path(numpath)      pathnames of input/output files                         *
20  !                                                                            *
21  ! Constants:                                                                 *
22  ! numpath            number of pathnames to be read in                       *
23  !                                                                            *
24  !*****************************************************************************
25
26  use par_mod
27  use com_mod
28
29  implicit none
30
31  integer   :: i
32  character(256) :: string_test
33  character(1) :: character_test
34
35  ! Read the pathname information stored in unitpath
36  !*************************************************
37
38  open(unitpath,file=trim(pathfile),status='old',err=999)
39
40  do i=1,numpath
41    read(unitpath,'(a)',err=998) path(i)
42    length(i)=index(path(i),' ')-1
43
44   
45    string_test = path(i)
46    character_test = string_test(length(i):length(i))
47    !print*, 'character_test,  string_test ', character_test,  string_test
48      if ((character_test .NE. '/') .AND. (i .LT. 4))  then
49         print*, 'WARNING: path not ending in /'
50         print*, path(i)
51         path(i) = string_test(1:length(i)) // '/'
52         length(i)=length(i)+1
53         print*, 'fix: padded with /'
54         print*, path(i)
55         print*, 'length(i) increased 1'
56      endif
57  end do
58
59  ! Check whether any nested subdomains are to be used
60  !***************************************************
61
62  do i=1,maxnests
63  ! ESO 2016 Added 'end'/'err' in case user forgot '====' at end of file and
64  ! maxnests > numbnests
65    read(unitpath,'(a)', end=30, err=30) path(numpath+2*(i-1)+1)
66    read(unitpath,'(a)', end=30, err=30) path(numpath+2*(i-1)+2)
67    if (path(numpath+2*(i-1)+1)(1:5).eq.'=====') goto 30
68    length(numpath+2*(i-1)+1)=index(path(numpath+2*(i-1)+1),' ')-1
69    length(numpath+2*(i-1)+2)=index(path(numpath+2*(i-1)+2),' ')-1
70  end do
71
72
73  ! Determine number of available nested domains
74  !*********************************************
75
7630   numbnests=i-1
77
78  close(unitpath)
79  return
80
81998   write(*,*) ' #### TRAJECTORY MODEL ERROR! ERROR WHILE     #### '
82  write(*,*) ' #### READING FILE PATHNAMES.                 #### '
83  stop
84
85999   write(*,*) ' #### TRAJECTORY MODEL ERROR! FILE "pathnames"#### '
86  write(*,*) ' #### CANNOT BE OPENED IN THE CURRENT WORKING #### '
87  write(*,*) ' #### DIRECTORY.                              #### '
88  stop
89
90end subroutine readpaths
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG