diff --git a/models/wrf_hydro/create_identity_streamflow_obs.f90 b/models/wrf_hydro/create_identity_streamflow_obs.f90 index aeaa661996..2479f21e31 100644 --- a/models/wrf_hydro/create_identity_streamflow_obs.f90 +++ b/models/wrf_hydro/create_identity_streamflow_obs.f90 @@ -66,7 +66,7 @@ program create_identity_streamflow_obs integer, parameter :: NUM_COPIES = 1 ! number of copies in sequence integer, parameter :: NUM_QC = 1 ! number of QC entries real(r8), parameter :: MIN_OBS_ERR_STD = 0.1_r8 ! m^3/sec -real(r8), parameter :: MAX_OBS_ERR_STD = 100000.0_r8 +real(r8), parameter :: MAX_OBS_ERR_STD = 1000000.0_r8 real(r8), parameter :: NORMAL_FLOW = 10.0_r8 real(r8), parameter :: contract = 0.001_r8 @@ -104,7 +104,7 @@ program create_identity_streamflow_obs real(r8), allocatable :: discharge(:) character(len=IDLength), allocatable :: desired_gages(:) -integer :: n_wanted_gages +integer :: n_wanted_gages, n_desired_gages real(r8) :: oerr, qc integer :: oday, osec type(obs_type) :: obs @@ -209,9 +209,18 @@ program create_identity_streamflow_obs call init_obs(obs, num_copies=NUM_COPIES, num_qc=NUM_QC) call init_obs(prev_obs, num_copies=NUM_COPIES, num_qc=NUM_QC) -n_wanted_gages = set_desired_gages(gages_list_file) +! MEG 6/29/23 [Commented out set_desired_gages(gages_list_file)] +! Collect all the gauges: +! - desired ones will have the provided obs_err_sd +! - remaining gauges are dummy with very large obs_err_sd + +n_desired_gages = set_desired_gages(gages_list_file) +n_wanted_gages = 0 !set_desired_gages(gages_list_file) call find_textfile_dims(input_files, nfiles) +print *, gages_list_file +print *, 'n_wanted_gages: ', n_wanted_gages + num_new_obs = estimate_total_obs_count(input_files, nfiles) inquire(file=output_file, exist=file_exist) @@ -316,12 +325,21 @@ program create_identity_streamflow_obs if (indx == 0) cycle OBSLOOP ! relate the physical location to the dart state vector index - dart_index = linkloc_to_dart(lat(indx), lon(indx)) + dart_index = linkloc_to_dart(lat(indx), lon(indx)) + + ! desired gauges get the provided obs_err + ! remaining ones are for verification purposes + if (ANY(desired_gages == station_strings(n))) then + oerr = max(discharge(n)*obs_fraction_for_error, MIN_OBS_ERR_STD) + else + oerr = MAX_OBS_ERR_STD + endif + ! MEG: 6/29/23 [Commented out, oerr is conditionally computed now] ! oerr is the observation error standard deviation in this application. ! The observation error variance encoded in the observation file ! will be oerr*oerr - oerr = max(discharge(n)*obs_fraction_for_error, MIN_OBS_ERR_STD) + !oerr = max(discharge(n)*obs_fraction_for_error, MIN_OBS_ERR_STD) ! MEG: A fix to not crush the ensemble in a no-flood period (stagnant water). !if ( discharge(n) < NORMAL_FLOW ) then