Opened 5 years ago

Last modified 4 years ago

#115 accepted Defect

Bug in readspecies.f90

Reported by: pesei Owned by: pesei
Priority: major Milestone: FLEXPART 9.2
Component: FP coding/compilation Version: FLEXPART 9.0.2
Keywords: Cc:

Description

I found a bug in readspecies.f90, probably introduced with the modulation of releases as a function of day of week and hour of day, and more with intro of namelists.

1. Wrong address for premature end of SPECIES

In the lines

    read(unitspecies,'(a10)',end=22) species(id_pos)
  !  write(*,*) species(id_pos)

etc., the place to jump to must be 20, otherwise area_hour, point_hour, area_dow, point_dow are not intialised.

2. Attempt to read modulation factors

If we are already at EOF, we can't use end= anymore, so use err=22.

3. Assignment to namelist

(maybe that should go into #94)

    pspecies=species(id_pos)
    pdecay=decay(id_pos)
    pweta=weta(id_pos)
    pwetb=wetb(id_pos)
    pweta_in=weta_in(id_pos)
    pwetb_in=wetb_in(id_pos)
    pwetc_in=wetc_in(id_pos)
    pwetd_in=wetd_in(id_pos)
    preldiff=reldiff(id_pos)
    phenry=henry(id_pos)
    pf0=f0(id_pos)
    pdensity=density(id_pos)
    pdquer=dquer(id_pos)
    pdsigma=dsigma(id_pos)
    pdryvel=dryvel(id_pos)
    pweightmolar=weightmolar(id_pos)
    pohreact=ohreact(id_pos)
    pspec_ass=spec_ass(id_pos)
    pkao=kao(id_pos)

has to be split and each line to be put below the corresponding read statement.

There is more stuff that should be cleaned up even if it does not give bugs. I started to do so in my wet depo work.

Change History (2)

comment:1 Changed 5 years ago by pesei

Improvement possible

    read(unitspecies,*,iostat=ios)
    if (ios .ne. 0) goto 22 ! ifort does not like err=
    do j=1,24     ! 24 hours, starting with 0-1 local time
      read(unitspecies,*) ihour,area_hour(id_pos,j),point_hour(id_pos,j)
    end do
    read(unitspecies,*)
    do j=1,7      ! 7 days of the week, starting with Monday
      read(unitspecies,*) idow,area_dow(id_pos,j),point_dow(id_pos,j)
    end do

variables j and ihour, j and idow should be checked for matching. Otherwise, what are they good for?

comment:2 Changed 4 years ago by pesei

  • Owner changed from somebody to pesei
  • Status changed from new to accepted

will be fixed as part of #94

Note: See TracTickets for help on using tickets.
hosted by ZAMG