Skip to content

Commit fff5d0c

Browse files
authored
Merge pull request #141 from metno/bomb_dose_fix
fix bomb-dose decay formula to start at H+1
2 parents 33c1cea + 6876975 commit fff5d0c

File tree

4 files changed

+34
-11
lines changed

4 files changed

+34
-11
lines changed

src/common/decay.f90

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,24 @@ end subroutine decay
4545
!> Purpose: Decrease radioactive contents of deposition fields
4646
!> due to decay
4747
!>
48+
!> param: tstep model timestep in seconds
4849
!> NEEDS TO BE RUN BEFORE ::decay
4950
subroutine decayDeps(tstep)
5051
USE snapfldML, only: depdry, depwet, accdry, accwet, &
5152
total_activity_released, total_activity_lost_domain, total_activity_lost_other
5253
USE snapparML, only: ncomp, run_comp, def_comp
5354
USE iso_fortran_env, only: real64
55+
USE releaseML, only: tpos_bomb
5456

5557
real, intent(in) :: tstep
5658

5759
integer :: m, mm
5860
real :: bomb_decay_rate, current_state, next_state
5961
logical, save :: prepare = .TRUE.
6062
logical, save :: has_bomb_decay = .FALSE.
61-
!> totalstep in seconds run in decay
63+
!> totalstep in seconds run in decay, assumed to be H+1 after release (stable cloud)
6264
!> start at 1h to satisfy C(t) = C_0 * t^-1.2 (t in [hrs])
63-
real(real64), save :: total_steps = 3600.
65+
real(real64), save :: total_steps = 0.
6466

6567
if(prepare) then
6668
!..radioactive decay rate
@@ -78,13 +80,20 @@ subroutine decayDeps(tstep)
7880
prepare= .FALSE.
7981
end if
8082

81-
! bomb t[h]^-1.2 power-function,
83+
! bomb t[h]^-1.2 power-function,
8284
! see glassstone/dolan: effects of nuclear weapons
8385
! converted to decay-rate factor per tstep
86+
! initial release to be defined at H+1
8487
if (has_bomb_decay) then
85-
current_state = (total_steps/3600.)**(-1.2)
86-
next_state = ((total_steps+tstep)/3600.)**(-1.2)
87-
bomb_decay_rate = next_state/current_state
88+
if (total_steps >= (3600+tpos_bomb)) then
89+
! start decay after 1h after explosion
90+
current_state = ((total_steps-tpos_bomb)/3600.)**(-1.2)
91+
next_state = ((total_steps+tstep-tpos_bomb)/3600.)**(-1.2)
92+
bomb_decay_rate = next_state/current_state
93+
else
94+
! no decay before release+1h
95+
bomb_decay_rate = 1.
96+
end if
8897
do m=1,ncomp
8998
mm = run_comp(m)%to_defined
9099
if (def_comp(mm)%kdecay == 2) then

src/common/release.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ module releaseML
9999
!> max. no. of particles, total in all plumes, preset, can be configured in snap.input
100100
integer, save, public :: mpart = mpartpre
101101

102+
!> seconds since start of run when bomb-release occurs
103+
integer, save, public :: tpos_bomb = 0
104+
102105
contains
103106

104107
subroutine release(istep,nsteph,tf1,tf2,tnow,ierror)

src/common/snap.F90

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ PROGRAM bsnap
169169
USE snapmetML, only: init_meteo_params, met_params
170170
USE snapparML, only: component, run_comp, &
171171
ncomp, def_comp, nparnum, &
172-
time_profile
172+
time_profile, TIME_PROFILE_BOMB
173173
USE snapposML, only: irelpos, nrelpos, release_positions
174174
USE snapgrdML, only: modleveldump, ivcoor, &
175175
klevel, imslp, itotcomp, gparam, &
@@ -191,7 +191,7 @@ PROGRAM bsnap
191191
USE decayML, only: decay, decayDeps
192192
USE posintML, only: posint, posint_init
193193
USE bldpML, only: bldp
194-
USE releaseML, only: release, releases, nrelheight, mprel, &
194+
USE releaseML, only: release, releases, tpos_bomb, nrelheight, mprel, &
195195
mplume, nplume, iplume, npart, mpart, release_t
196196
USE init_random_seedML, only: init_random_seed
197197
USE compheightML, only: compheight
@@ -524,13 +524,24 @@ PROGRAM bsnap
524524
ncsummary = trim(ncsummary)//". Release "//trim(def_comp(m)%compname) &
525525
//" (hour, Bq/s): "
526526
do i = 1, ntprof
527-
write (iulog, *) ' hour,Bq/hour: ', &
528-
releases(i)%frelhour, (releases(i)%relbqsec(n, ih)*3600., ih=1, nrelheight)
527+
if (time_profile /= TIME_PROFILE_BOMB) then
528+
write (iulog, *) ' hour,Bq/hour: ', &
529+
releases(i)%frelhour, (releases(i)%relbqsec(n, ih)*3600., ih=1, nrelheight)
530+
else
531+
write (iulog, *) ' hour,Bq: ', &
532+
releases(i)%frelhour, (releases(i)%relbqsec(n, ih), ih=1, nrelheight)
533+
if (tpos_bomb == 0) then
534+
if (any(releases(i)%relbqsec > 0.)) tpos_bomb = releases(i)%frelhour * 3600
535+
end if
536+
end if
529537
write (tempstr, '("(",f5.1,",",ES9.2,")")') &
530538
releases(i)%frelhour, releases(i)%relbqsec(n, 1)
531539
ncsummary = trim(ncsummary)//" "//trim(tempstr)
532540
end do
533541
end do
542+
if (time_profile == TIME_PROFILE_BOMB) then
543+
write (iulog, *) 'tpos_bomb: ', tpos_bomb
544+
end if
534545
write (iulog, *) 'itotcomp: ', itotcomp
535546
write (iulog, *) 'blfulmix: ', blfullmix
536547
write (error_unit, *) 'Title: ', trim(nctitle)

src/common/snap.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ bldp.o: ../common/bldp.f90 snapdimML.o snaptabML.o snapgrdML.o snapfldML.o ftest
5959
${F77} -c ${F77FLAGS} $(INCLUDES) $<
6060
particleML.o: ../common/particleML.f90
6161
${F77} -c ${F77FLAGS} $<
62-
decay.o: ../common/decay.f90 particleML.o snapfldML.o snapparML.o
62+
decay.o: ../common/decay.f90 particleML.o snapfldML.o snapparML.o release.o
6363
${F77} -c ${F77FLAGS} $(INCLUDES) $<
6464
compheight.o: ../common/compheight.f90 snapgrdML.o snapfldML.o snaptabML.o snapdimML.o ftest.o
6565
${F77} -c ${F77FLAGS} $(INCLUDES) $<

0 commit comments

Comments
 (0)