From b7ac2df190dddccabf5e21264f3510b0ce07812a Mon Sep 17 00:00:00 2001 From: Casper Boon Date: Thu, 4 Oct 2018 18:09:11 +0800 Subject: [PATCH] first pass at adding velocity to nitrogen --- src/aed2_nitrogen.F90 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/aed2_nitrogen.F90 b/src/aed2_nitrogen.F90 index 60ae3de..b2d13e2 100644 --- a/src/aed2_nitrogen.F90 +++ b/src/aed2_nitrogen.F90 @@ -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, & @@ -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 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -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.