Changes in trunk/src/readreceptors.f90 [27:4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/readreceptors.f90
r27 r4 27 27 ! * 28 28 ! Author: A. Stohl * 29 ! * 29 30 ! 1 August 1996 * 30 ! HSO, 14 August 201331 ! Added optional namelist input32 31 ! * 33 32 !***************************************************************************** … … 52 51 character(len=16) :: receptor 53 52 54 integer :: readerror55 real :: lon,lat ! for namelist input, lon/lat are used instead of x,y56 integer,parameter :: unitreceptorout=257 58 ! declare namelist59 namelist /receptors/ &60 receptor, lon, lat61 62 lon=-999.963 53 64 54 ! For backward runs, do not allow receptor output. Thus, set number of receptors to zero … … 74 64 !************************************************************ 75 65 76 open(unitreceptor,file=path(1)(1:length(1))//'RECEPTORS',form='formatted',status='old',err=999) 66 open(unitreceptor,file=path(1)(1:length(1))//'RECEPTORS', & 67 status='old',err=999) 77 68 78 ! try namelist input 79 read(unitreceptor,receptors,iostat=readerror) 69 call skplin(5,unitreceptor) 80 70 81 ! prepare namelist output if requested82 if (nmlout.eqv..true.) then83 open(unitreceptorout,file=path(2)(1:length(2))//'RECEPTORS.namelist',access='append',status='new',err=1000)84 endif85 71 86 if ((lon.lt.-900).or.(readerror.ne.0)) then 72 ! Read the names and coordinates of the receptors 73 !************************************************ 87 74 88 close(unitreceptor) 89 open(unitreceptor,file=path(1)(1:length(1))//'RECEPTORS',status='old',err=999) 90 call skplin(5,unitreceptor) 91 92 ! Read the names and coordinates of the receptors 93 !************************************************ 94 95 j=0 96 100 j=j+1 75 j=0 76 100 j=j+1 97 77 read(unitreceptor,*,end=99) 98 78 read(unitreceptor,*,end=99) … … 109 89 endif 110 90 if (j.gt.maxreceptor) then 111 112 113 114 91 write(*,*) ' #### FLEXPART MODEL ERROR! TOO MANY RECEPTOR #### ' 92 write(*,*) ' #### POINTS ARE GIVEN. #### ' 93 write(*,*) ' #### MAXIMUM NUMBER IS ',maxreceptor,' #### ' 94 write(*,*) ' #### PLEASE MAKE CHANGES IN FILE RECEPTORS #### ' 115 95 endif 116 96 receptorname(j)=receptor … … 120 100 ym=r_earth*dy/180.*pi 121 101 receptorarea(j)=xm*ym 122 123 ! write receptors file in namelist format to output directory if requested124 if (nmlout.eqv..true.) then125 lon=x126 lat=y127 write(unitreceptorout,nml=receptors)128 endif129 130 102 goto 100 131 103 132 99 numreceptor=j-1 133 134 else ! continue with namelist input 135 136 j=0 137 do while (readerror.eq.0) 138 j=j+1 139 lon=-999.9 140 read(unitreceptor,receptors,iostat=readerror) 141 if ((lon.lt.-900).or.(readerror.ne.0)) then 142 readerror=1 143 else 144 if (j.gt.maxreceptor) then 145 write(*,*) ' #### FLEXPART MODEL ERROR! TOO MANY RECEPTOR #### ' 146 write(*,*) ' #### POINTS ARE GIVEN. #### ' 147 write(*,*) ' #### MAXIMUM NUMBER IS ',maxreceptor,' #### ' 148 write(*,*) ' #### PLEASE MAKE CHANGES IN FILE RECEPTORS #### ' 149 endif 150 receptorname(j)=receptor 151 xreceptor(j)=(lon-xlon0)/dx ! transform to grid coordinates 152 yreceptor(j)=(lat-ylat0)/dy 153 xm=r_earth*cos(lat*pi/180.)*dx/180.*pi 154 ym=r_earth*dy/180.*pi 155 receptorarea(j)=xm*ym 156 endif 157 158 ! write receptors file in namelist format to output directory if requested 159 if (nmlout.eqv..true.) then 160 write(unitreceptorout,nml=receptors) 161 endif 162 163 end do 164 numreceptor=j-1 165 close(unitreceptor) 166 167 endif 168 169 if (nmlout.eqv..true.) then 170 close(unitreceptorout) 171 endif 172 104 99 numreceptor=j-1 105 close(unitreceptor) 173 106 return 174 107 175 108 176 999 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "RECEPTORS" #### '109 999 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "RECEPTORS" #### ' 177 110 write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY #### ' 178 111 write(*,'(a)') path(1)(1:length(1)) 179 112 stop 180 113 181 1000 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "RECEPTORS" #### '182 write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY #### '183 write(*,'(a)') path(2)(1:length(2))184 stop185 186 114 end subroutine readreceptors
Note: See TracChangeset
for help on using the changeset viewer.