[Dart-dev] DART/branches Revision: 12958

dart at ucar.edu dart at ucar.edu
Tue Jan 29 10:47:59 MST 2019


hendric at ucar.edu
2019-01-29 10:47:59 -0700 (Tue, 29 Jan 2019)
61

adding channel_list and model_levels to obs_def_rttov_nml.




Modified: DART/branches/radiance/observations/forward_operators/obs_def_rttov_mod.f90
===================================================================
--- DART/branches/radiance/observations/forward_operators/obs_def_rttov_mod.f90	2019-01-13 00:35:46 UTC (rev 12957)
+++ DART/branches/radiance/observations/forward_operators/obs_def_rttov_mod.f90	2019-01-29 17:47:59 UTC (rev 12958)
@@ -64,11 +64,12 @@
 use        types_mod, only : r8, PI, metadatalength, MISSING_R8, MISSING_I
 use    utilities_mod, only : register_module, error_handler, E_ERR, E_WARN, E_MSG, &
                              logfileunit, get_unit, open_file, close_file, nc_check, &
-                             file_exist, ascii_file_format
+                             file_exist, ascii_file_format, nmlfileunit, do_nml_file, &
+                             do_nml_term, check_namelist_read, find_namelist_in_file
 use     location_mod, only : location_type, set_location, get_location, VERTISUNDEF, &
                              VERTISHEIGHT, VERTISLEVEL, set_location_missing
 use     obs_kind_mod, only : QTY_GEOPOTENTIAL_HEIGHT, QTY_PRESSURE, QTY_TEMPERATURE, &
-                             QTY_SPECIFIC_HUMIDITY
+                             QTY_SPECIFIC_HUMIDITY, QTY_VAPOR_MIXING_RATIO
 use  assim_model_mod, only : interpolate
 
 use obs_def_utilities_mod, only : track_status
@@ -91,9 +92,6 @@
 ! then the converters just use the metadata and filter
 ! uses both...  or something.
 
-! JPH, namelist for which channels to use and how many model levels there are
-! see GPS module
-
 public ::            set_rttov_metadata, &
                      get_rttov_metadata, &
                     read_rttov_metadata, &
@@ -109,6 +107,7 @@
 
 character(len=512) :: string1, string2
 logical, save      :: module_initialized = .false.
+integer            :: iunit, rc
 
 ! Metadata for rttov observations.
 
@@ -136,10 +135,18 @@
 type(obs_metadata) :: missing_metadata
 character(len=5), parameter :: RTTOVSTRING = 'rttov'
 
-logical :: debug = .FALSE.
+logical :: debug = .TRUE.
 integer :: MAXrttovkey = 100000  !FIXME - some initial number of obs
 integer ::    rttovkey = 0       ! useful length of metadata arrays
 
+! JPH, namelist for which channels to use and how many model levels there are
+! see GPS module
+
+integer :: model_levels
+integer :: channel_list(1) = 1
+
+namelist / obs_def_rttov_nml/ channel_list, model_levels
+
 contains
 
 
@@ -148,7 +155,6 @@
 subroutine initialize_module
 
 integer :: istatus
-integer :: local_channel_list(1)
 
 call register_module(source, revision, revdate)
 
@@ -168,11 +174,21 @@
 observation_metadata(:) = missing_metadata
 
 !FIXME : do we need to pass in all of the potential channels here
-local_channel_list(1) = 1
 
-call dart_rttov_setup(nprofiles=1, nchannels=1, channel_list=local_channel_list, &
-                      nlevels=1, level_list=1, error_status=istatus)
+! Read the namelist entry
+call find_namelist_in_file("input.nml", "obs_def_rttov_nml", iunit)
+read(iunit, nml = obs_def_rttov_nml, iostat = rc)
+call check_namelist_read(iunit, rc, "obs_def_rttov_nml")
 
+! Record the namelist values used for the run ...
+if (do_nml_file()) write(nmlfileunit, nml=obs_def_rttov_nml)
+if (do_nml_term()) write(     *     , nml=obs_def_rttov_nml)
+
+print*, 'dart_rttov_setup'
+call dart_rttov_setup(nprofiles=2, nchannels=1, channel_list=channel_list, &
+                      nlevels=model_levels, level_list=1, error_status=istatus)
+!call exit(0)
+
 end subroutine initialize_module
 
 !----------------------------------------------------------------------
@@ -246,11 +262,14 @@
 real(r8)          :: sat_az, sat_ze, sun_az, sun_ze
 integer           :: platform, sat_id, sensor, channel
 
+print*, 'read_rttov_metadata'
+
 if ( .not. module_initialized ) call initialize_module
 
 is_asciifile = ascii_file_format(fform)
 
 write(string2,*)'observation #',obsID


More information about the Dart-dev mailing list