| 1 | subroutine radioactive_tracers(ngrid,nlayer,nq,ptimestep,pq,zdqradio) |
|---|
| 2 | |
|---|
| 3 | USE tracer_h, only: half_life, top_prod, bot_prod, noms |
|---|
| 4 | implicit none |
|---|
| 5 | |
|---|
| 6 | !================================================================== |
|---|
| 7 | ! |
|---|
| 8 | ! Purpose |
|---|
| 9 | ! ------- |
|---|
| 10 | ! Calculates the decay of radioactive tracers |
|---|
| 11 | ! |
|---|
| 12 | ! Authors |
|---|
| 13 | ! ------- |
|---|
| 14 | ! Maxime Maurice (14/04/2025) |
|---|
| 15 | ! |
|---|
| 16 | !================================================================== |
|---|
| 17 | |
|---|
| 18 | ! Arguments |
|---|
| 19 | integer,intent(in) :: ngrid ! number of atmospheric columns |
|---|
| 20 | integer,intent(in) :: nlayer ! number of atmospheric layers |
|---|
| 21 | integer,intent(in) :: nq ! number of tracers |
|---|
| 22 | real,intent(in) :: ptimestep ! time interval |
|---|
| 23 | real,intent(in) :: pq(ngrid,nlayer,nq) ! tracers (kg/kg) |
|---|
| 24 | real,intent(out) :: zdqradio(ngrid,nlayer,nq) ! radioactive tracers tendencies |
|---|
| 25 | |
|---|
| 26 | ! Local variables |
|---|
| 27 | integer iq |
|---|
| 28 | |
|---|
| 29 | zdqradio(1:ngrid,1:nlayer,1:nq) = 0 |
|---|
| 30 | do iq=1,nq |
|---|
| 31 | if (half_life(iq) .ne. 0) then |
|---|
| 32 | ! SOURCE |
|---|
| 33 | ! bottom |
|---|
| 34 | if (bot_prod(iq) .ne. 0) then |
|---|
| 35 | zdqradio(1:ngrid,1,iq) = zdqradio(1:ngrid,1,iq) + bot_prod(iq) ! <== bottom production |
|---|
| 36 | end if ! bot_prod != 0 |
|---|
| 37 | ! top |
|---|
| 38 | if (top_prod(iq) .ne. 0) then |
|---|
| 39 | zdqradio(1:ngrid,nlayer,iq) = zdqradio(1:ngrid,nlayer,iq) + top_prod(iq) ! <== top production (prod = log(2)/half_life) |
|---|
| 40 | end if ! bot_prod != 0 |
|---|
| 41 | |
|---|
| 42 | ! DECAY |
|---|
| 43 | if (half_life(iq)/10 .le. ptimestep) then ! sanity test |
|---|
| 44 | write(*,*)"timestep is more than half-life / 10 of tracer ", noms(iq) |
|---|
| 45 | call abort_physic("radioactive_tracers","timestep is more than half-life / 10 of tracer",1) |
|---|
| 46 | end if ! dt > 0.1 * half_life |
|---|
| 47 | zdqradio(1:ngrid,1:nlayer,iq) = zdqradio(1:ngrid,1:nlayer,iq) - LOG(2.)/half_life(iq)*pq(1:ngrid,1:nlayer,iq) ! <== decay |
|---|
| 48 | end if ! half_life(iq) != 0 |
|---|
| 49 | end do ! iq=1,nq |
|---|
| 50 | |
|---|
| 51 | end subroutine radioactive_tracers |
|---|
| 52 | |
|---|