Skip to content

Commit

Permalink
first pass at adding velocity to nitrogen
Browse files Browse the repository at this point in the history
  • Loading branch information
casper-boon committed Oct 4, 2018
1 parent ae83606 commit b7ac2df
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/aed2_nitrogen.F90
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ MODULE aed2_nitrogen
INTEGER :: id_nitrf, id_denit, id_n2op, id_anammox, id_dnra
INTEGER :: id_sed_amm, id_sed_nit, id_sed_n2o
INTEGER :: id_atm_n2o, id_atm_dep
INTEGER :: id_cell_vel

!# Model parameters
AED_REAL :: Rnitrif,Rdenit,Ranammox,Rn2o,Rdnra, &
Expand Down Expand Up @@ -293,7 +294,7 @@ SUBROUTINE aed2_define_nitrogen(data, namlst)
IF( simN2O ) data%id_E_depth= aed2_locate_global('layer_ht')
IF( simN2O ) data%id_E_tau = aed2_locate_global('taub') ! tau to be converted to velocity
IF( simN2O ) data%id_E_dens = aed2_locate_global('density') ! density needed for tau-vel
!data%id_E_vel = aed2_locate_global('velocity') ! needed for k600
data%id_cell_vel = aed2_locate_global('cell_vel') ! needed for k600

END SUBROUTINE aed2_define_nitrogen
!+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Expand Down Expand Up @@ -495,9 +496,13 @@ SUBROUTINE aed2_calculate_surface_nitrogen(data,column,layer_idx)
wind_hgt = 10.
depth = MAX( _STATE_VAR_(data%id_E_depth), one_ )

IF (data%id_cell_vel > 0 ) THEN
vel = _STATE_VAR_(data%id_cell_vel)
ELSE
! vel = SQRT(_STATE_VAR_(data%id_E_tau)/_STATE_VAR_(data%id_E_dens))
! vel = vel/0.41 * log(depth/0.01)
vel = 0.0001
vel = 0.0001
ENDIF

!-----------------------------------------------
! Retrieve current (local) state variable values.
Expand Down

0 comments on commit b7ac2df

Please sign in to comment.