Commit b0822bb3 authored by dingwell's avatar dingwell
Browse files

Bugfix and new error message

Flexpart-wrf didn't complain if the species list contained more entries
(numtable) than the maximum number of species (maxspec). This resulted in
terrible out of bound nastiness.

Furthermore a faulty label/address was fixed (see ticket #110).
parent 00decbe2
......@@ -1387,6 +1387,12 @@ subroutine readinput
read(unitpath,*)
read(unitpath,*) numtable
read(unitpath,*)
if(numtable.gt.maxspec) then
write(*,*) 'Number entries in SPECIES table (numtable) exceeds maxspec'
write(*,*) 'Reduce numtable and adjust number of entries accordingly OR'
write(*,*) 'increase maxspec in par_mod.f90 and re-compile flexpart-wrf'
stop
endif
do i=1,numtable
read(unitpath,21) specname(i),decaytime(i), &
......@@ -1893,6 +1899,7 @@ subroutine readinput
! nparttot2=nparttot
if (ipin.eq.1) then
if (option_verbose.ge.1) print*, "Attempting to read previously dumped particles"
if (iouttype .eq. 0 .or. iouttype .eq.2) then
open(unitpartin,file=path(1)(1:length(1))//'partposit_end', &
form='unformatted',err=998)
......@@ -1902,11 +1909,12 @@ subroutine readinput
endif
if(option_verbose .ge. 1) print*,'numpart_in',numpart_in
if (iouttype .eq. 0 .or. iouttype .eq.2) then
read(unitpartin,end=99) itimein,numpart_in, iomode_xycoord_in
read(unitpartin,end=101) itimein,numpart_in, iomode_xycoord_in !AD: changed label to 101
else
read(unitpartin,*,end=99) itimein,numpart_in, iomode_xycoord_in
read(unitpartin,*,end=101) itimein,numpart_in, iomode_xycoord_in !AD: changed label to 101
endif
close(unitpartin)
101 close(unitpartin) ! AD: close when end of file is reached
if(option_verbose.ge.1) print*, "Finished reading dumped particles"
!else
! numpart_in=0 # Removed in merge with JB
endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment