[Dart-dev] DART/branches Revision: 12379
dart at ucar.edu
dart at ucar.edu
Thu Jan 25 15:35:22 MST 2018
nancy at ucar.edu
2018-01-25 15:35:21 -0700 (Thu, 25 Jan 2018)
242
separate getting the molar mass from getting
the volume mixing ratio. use the univeral_gas_constant
in the build_heights routine if passing in variable mass.
don't correct units if calling the internal routine to
get the molar mass values.
Modified: DART/branches/recam/models/cam-fv/chem_tables_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/chem_tables_mod.f90 2018-01-25 18:12:39 UTC (rev 12378)
+++ DART/branches/recam/models/cam-fv/chem_tables_mod.f90 2018-01-25 22:35:21 UTC (rev 12379)
@@ -20,9 +20,10 @@
implicit none
private
-public :: init_chem_tables, &
+public :: init_chem_tables, &
finalize_chem_tables, &
- chem_convert_factor
+ get_molar_mass, &
+ get_volume_mixing_ratio
!public :: chem_convert_factors, molar_mass_dry_air
@@ -73,13 +74,12 @@
enddo
! and now add entries for real items
-call add_entry('H', 1.0_r8, 'QTY_ATOMIC_H_MIXING_RATIO')
-call add_entry('N2', 28.0_r8, 'QTY_NITROGEN')
+call add_entry('H', 1.0074_r8, 'QTY_ATOMIC_H_MIXING_RATIO')
call add_entry('O', 15.9994_r8, 'QTY_ATOMIC_OXYGEN_MIXING_RATIO')
-call add_entry('O2', 32.0_r8, 'QTY_MOLEC_OXYGEN_MIXING_RATIO')
+call add_entry('O2', 31.9988_r8, 'QTY_MOLEC_OXYGEN_MIXING_RATIO')
call add_entry('O3', 47.9982_r8, 'QTY_O3')
+call add_entry('N2', 28.0135_r8, 'QTY_NITROGEN')
-! call add_entry('O1D', 15.9994_r8, 'QTY_O1D')
!%! 'N2O ', 44.01288, 'QTY_N2O ', &
!%! 'NO ', 30.00614, 'QTY_NO ', &
@@ -272,22 +272,39 @@
!--------------------------------------------------------------------
!>
+function get_molar_mass(qty)
-function chem_convert_factor(qty)
+integer, intent(in) :: qty
+real(r8) :: get_molar_mass
+if (qty < 0 .or. qty > num_qtys) then
+ write(string1,'(A,I6,A,I6)') 'quantity number ', qty, &
+ ' must be between 0 and ', num_qtys
+ call error_handler(E_ERR, 'get_molar_mass', string1, &
+ source, revision, revdate)
+endif
+
+get_molar_mass = chem_conv_table(qty)%convert_factor
+
+end function get_molar_mass
+
+!--------------------------------------------------------------------
+!>
+function get_volume_mixing_ratio(qty)
+
integer, intent(in) :: qty
-real(r8) :: chem_convert_factor
+real(r8) :: get_volume_mixing_ratio
if (qty < 0 .or. qty > num_qtys) then
write(string1,'(A,I6,A,I6)') 'quantity number ', qty, &
' must be between 0 and ', num_qtys
- call error_handler(E_ERR, 'chem_convert_factor', string1, &
+ call error_handler(E_ERR, 'get_volume_mixing_ratio', string1, &
source, revision, revdate)
endif
-chem_convert_factor = chem_conv_table(qty)%convert_factor !* molar_mass_dry_air !??
+get_volume_mixing_ratio = molar_mass_dry_air / chem_conv_table(qty)%convert_factor
-end function chem_convert_factor
+end function get_volume_mixing_ratio
!--------------------------------------------------------------------
Modified: DART/branches/recam/models/cam-fv/model_mod.f90
===================================================================
--- DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-25 18:12:39 UTC (rev 12378)
+++ DART/branches/recam/models/cam-fv/model_mod.f90 2018-01-25 22:35:21 UTC (rev 12379)
@@ -77,7 +77,7 @@
nc_begin_define_mode, nc_open_file_readonly, &
nc_close_file, nc_variable_exists
use chem_tables_mod, only : init_chem_tables, finalize_chem_tables, &
- chem_convert_factor
+ get_molar_mass, get_volume_mixing_ratio
use quad_utils_mod, only : quad_interp_handle, init_quad_interp, &
set_quad_coords, finalize_quad_interp, &
quad_lon_lat_locate, quad_lon_lat_evaluate, &
@@ -170,7 +170,7 @@
fields_to_perturb, &
perturbation_amplitude, &
use_variable_mean_mass, &
- using_chemistry, &
+ using_chemistry, &
debug_level
More information about the Dart-dev
mailing list