Changes in trunk/src/readspecies.f90 [28:4]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/readspecies.f90
r28 r4 30 30 ! * 31 31 ! 11 July 1996 * 32 !33 ! Changes: *34 ! N. Kristiansen, 31.01.2013: Including parameters for in-cloud scavenging *35 ! *36 ! HSO, 13 August 201337 ! added optional namelist input38 32 ! * 39 33 !***************************************************************************** … … 42 36 ! decaytime(maxtable) half time for radiological decay * 43 37 ! specname(maxtable) names of chemical species, radionuclides * 44 ! weta, wetb Parameters for determining below-cloud scavenging * 45 ! weta_in Parameter for determining in-cloud scavenging * 46 ! wetb_in Parameter for determining in-cloud scavenging * 47 ! wetc_in Parameter for determining in-cloud scavenging * 48 ! wetd_in Parameter for determining in-cloud scavenging * 38 ! wetscava, wetscavb Parameters for determining scavenging coefficient * 49 39 ! ohreact OH reaction rate * 50 40 ! id_spec SPECIES number as referenced in RELEASE file * … … 65 55 logical :: spec_found 66 56 67 character(len=16) :: pspecies68 real :: pdecay, pweta, pwetb, preldiff, phenry, pf0, pdensity, pdquer69 real :: pdsigma, pdryvel, pweightmolar, pohreact, pspec_ass, pkao70 real :: pweta_in, pwetb_in, pwetc_in, pwetd_in71 integer :: readerror72 73 ! declare namelist74 namelist /species_params/ &75 pspecies, pdecay, pweta, pwetb, &76 pweta_in, pwetb_in, pwetc_in, pwetd_in, &77 preldiff, phenry, pf0, pdensity, pdquer, &78 pdsigma, pdryvel, pweightmolar, pohreact, pspec_ass, pkao79 80 pspecies=" "81 pdecay=-999.982 pweta=-9.9E-0983 pwetb=0.084 pweta_in=-9.9E-0985 pwetb_in=-9.9E-0986 pwetc_in=-9.9E-0987 pwetd_in=-9.9E-0988 preldiff=-9.989 phenry=0.090 pf0=0.091 pdensity=-9.9E0992 pdquer=0.093 pdsigma=0.094 pdryvel=-9.9995 pohreact=-9.9E-0996 pspec_ass=-997 pkao=-99.9998 pweightmolar=-789.0 ! read failure indicator value99 100 57 ! Open the SPECIES file and read species names and properties 101 58 !************************************************************ 102 59 specnum(pos_spec)=id_spec 103 60 write(aspecnumb,'(i3.3)') specnum(pos_spec) 104 open(unitspecies,file=path(1)(1:length(1))//'SPECIES/SPECIES_'//aspecnumb,status='old',form='formatted',err=998) 61 open(unitspecies,file= & 62 path(1)(1:length(1))//'SPECIES/SPECIES_'//aspecnumb,status='old', & 63 err=998) 105 64 !write(*,*) 'reading SPECIES',specnum(pos_spec) 106 65 107 66 ASSSPEC=.FALSE. 108 67 109 ! try namelist input 110 read(unitspecies,species_params,iostat=readerror) 111 close(unitspecies) 112 113 if ((pweightmolar.eq.-789.0).or.(readerror.ne.0)) then ! no namelist found 114 115 readerror=1 116 117 open(unitspecies,file=path(1)(1:length(1))//'SPECIES/SPECIES_'//aspecnumb,status='old',err=998) 118 119 do i=1,6 120 read(unitspecies,*) 121 end do 68 do i=1,6 69 read(unitspecies,*) 70 end do 122 71 123 72 read(unitspecies,'(a10)',end=22) species(pos_spec) … … 129 78 read(unitspecies,'(f18.2)',end=22) wetb(pos_spec) 130 79 ! write(*,*) wetb(pos_spec) 131 132 !*** NIK 31.01.2013: including in-cloud scavening parameters133 read(unitspecies,'(e18.1)',end=22) weta_in(pos_spec)134 ! write(*,*) weta_in(pos_spec)135 read(unitspecies,'(f18.2)',end=22) wetb_in(pos_spec)136 ! write(*,*) wetb_in(pos_spec)137 read(unitspecies,'(f18.2)',end=22) wetc_in(pos_spec)138 ! write(*,*) wetc_in(pos_spec)139 read(unitspecies,'(f18.2)',end=22) wetd_in(pos_spec)140 ! write(*,*) wetd_in(pos_spec)141 142 80 read(unitspecies,'(f18.1)',end=22) reldiff(pos_spec) 143 81 ! write(*,*) reldiff(pos_spec) … … 162 100 read(unitspecies,'(f18.2)',end=22) kao(pos_spec) 163 101 ! write(*,*) kao(pos_spec) 102 i=pos_spec 164 103 165 pspecies=species(pos_spec) 166 pdecay=decay(pos_spec) 167 pweta=weta(pos_spec) 168 pwetb=wetb(pos_spec) 169 pweta_in=weta_in(pos_spec) 170 pwetb_in=wetb_in(pos_spec) 171 pwetc_in=wetc_in(pos_spec) 172 pwetd_in=wetd_in(pos_spec) 173 preldiff=reldiff(pos_spec) 174 phenry=henry(pos_spec) 175 pf0=f0(pos_spec) 176 pdensity=density(pos_spec) 177 pdquer=dquer(pos_spec) 178 pdsigma=dsigma(pos_spec) 179 pdryvel=dryvel(pos_spec) 180 pweightmolar=weightmolar(pos_spec) 181 pohreact=ohreact(pos_spec) 182 pspec_ass=spec_ass(pos_spec) 183 pkao=kao(pos_spec) 104 if ((weta(pos_spec).gt.0).and.(henry(pos_spec).le.0)) then 105 if (dquer(pos_spec).le.0) goto 996 ! no particle, no henry set 106 endif 184 107 185 else 108 if (spec_ass(pos_spec).gt.0) then 109 spec_found=.FALSE. 110 do j=1,pos_spec-1 111 if (spec_ass(pos_spec).eq.specnum(j)) then 112 spec_ass(pos_spec)=j 113 spec_found=.TRUE. 114 ASSSPEC=.TRUE. 115 endif 116 end do 117 if (spec_found.eqv..FALSE.) then 118 goto 997 119 endif 120 endif 186 121 187 species(pos_spec)=pspecies 188 decay(pos_spec)=pdecay 189 weta(pos_spec)=pweta 190 wetb(pos_spec)=pwetb 191 weta_in(pos_spec)=pweta_in 192 wetb_in(pos_spec)=pwetb_in 193 wetc_in(pos_spec)=pwetc_in 194 wetd_in(pos_spec)=pwetd_in 195 reldiff(pos_spec)=preldiff 196 henry(pos_spec)=phenry 197 f0(pos_spec)=pf0 198 density(pos_spec)=pdensity 199 dquer(pos_spec)=pdquer 200 dsigma(pos_spec)=pdsigma 201 dryvel(pos_spec)=pdryvel 202 weightmolar(pos_spec)=pweightmolar 203 ohreact(pos_spec)=pohreact 204 spec_ass(pos_spec)=pspec_ass 205 kao(pos_spec)=pkao 122 if (dsigma(i).eq.1.) dsigma(i)=1.0001 ! avoid floating exception 123 if (dsigma(i).eq.0.) dsigma(i)=1.0001 ! avoid floating exception 206 124 207 endif 208 209 i=pos_spec 210 211 if ((weta(pos_spec).gt.0).and.(henry(pos_spec).le.0)) then 212 if (dquer(pos_spec).le.0) goto 996 ! no particle, no henry set 213 endif 214 215 if (spec_ass(pos_spec).gt.0) then 216 spec_found=.FALSE. 217 do j=1,pos_spec-1 218 if (spec_ass(pos_spec).eq.specnum(j)) then 219 spec_ass(pos_spec)=j 220 spec_found=.TRUE. 221 ASSSPEC=.TRUE. 222 endif 223 end do 224 if (spec_found.eqv..FALSE.) then 225 goto 997 125 if ((reldiff(i).gt.0.).and.(density(i).gt.0.)) then 126 write(*,*) '#### FLEXPART MODEL ERROR! FILE "SPECIES" ####' 127 write(*,*) '#### IS CORRUPT. SPECIES CANNOT BE BOTH ####' 128 write(*,*) '#### PARTICLE AND GAS. ####' 129 write(*,*) '#### SPECIES NUMBER',aspecnumb 130 stop 226 131 endif 227 endif228 229 if (dsigma(i).eq.1.) dsigma(i)=1.0001 ! avoid floating exception230 if (dsigma(i).eq.0.) dsigma(i)=1.0001 ! avoid floating exception231 232 if ((reldiff(i).gt.0.).and.(density(i).gt.0.)) then233 write(*,*) '#### FLEXPART MODEL ERROR! FILE "SPECIES" ####'234 write(*,*) '#### IS CORRUPT. SPECIES CANNOT BE BOTH ####'235 write(*,*) '#### PARTICLE AND GAS. ####'236 write(*,*) '#### SPECIES NUMBER',aspecnumb237 stop238 endif239 132 20 continue 240 133 … … 242 135 ! Read in daily and day-of-week variation of emissions, if available 243 136 !******************************************************************* 244 ! HSO: This is not yet implemented as namelist parameters245 ! default values set to 1246 137 247 do j=1,24 ! initialize everything to no variation 248 area_hour(i,j)=1. 249 point_hour(i,j)=1. 250 end do 251 do j=1,7 252 area_dow(i,j)=1. 253 point_dow(i,j)=1. 254 end do 255 256 if (readerror.ne.0) then ! text format input 138 do j=1,24 ! initialize everything to no variation 139 area_hour(i,j)=1. 140 point_hour(i,j)=1. 141 end do 142 do j=1,7 143 area_dow(i,j)=1. 144 point_dow(i,j)=1. 145 end do 257 146 258 147 read(unitspecies,*,end=22) … … 265 154 end do 266 155 267 endif 156 22 close(unitspecies) 268 157 269 22 close(unitspecies) 270 271 ! namelist output if requested 272 if (nmlout.eqv..true.) then 273 open(unitspecies,file=path(2)(1:length(2))//'SPECIES_'//aspecnumb//'.namelist',access='append',status='new',err=1000) 274 write(unitspecies,nml=species_params) 275 close(unitspecies) 276 endif 277 278 return 158 return 279 159 280 160 996 write(*,*) '#####################################################' … … 305 185 stop 306 186 307 1000 write(*,*) ' #### FLEXPART MODEL ERROR! FILE "SPECIES_',aspecnumb,'.namelist'308 write(*,*) ' #### CANNOT BE OPENED IN THE DIRECTORY #### '309 write(*,'(a)') path(2)(1:length(2))310 stop311 187 312 188 end subroutine readspecies
Note: See TracChangeset
for help on using the changeset viewer.