@@ -66,7 +66,7 @@ program create_identity_streamflow_obs
66
66
integer , parameter :: NUM_COPIES = 1 ! number of copies in sequence
67
67
integer , parameter :: NUM_QC = 1 ! number of QC entries
68
68
real (r8 ), parameter :: MIN_OBS_ERR_STD = 0.1_r8 ! m^3/sec
69
- real (r8 ), parameter :: MAX_OBS_ERR_STD = 100000 .0_r8
69
+ real (r8 ), parameter :: MAX_OBS_ERR_STD = 1000000 .0_r8
70
70
real (r8 ), parameter :: NORMAL_FLOW = 10.0_r8
71
71
real (r8 ), parameter :: contract = 0.001_r8
72
72
@@ -104,7 +104,7 @@ program create_identity_streamflow_obs
104
104
real (r8 ), allocatable :: discharge(:)
105
105
106
106
character (len= IDLength), allocatable :: desired_gages(:)
107
- integer :: n_wanted_gages
107
+ integer :: n_wanted_gages, n_desired_gages
108
108
real (r8 ) :: oerr, qc
109
109
integer :: oday, osec
110
110
type (obs_type) :: obs
@@ -127,6 +127,7 @@ program create_identity_streamflow_obs
127
127
character (len= 256 ) :: location_file = ' location.nc'
128
128
character (len= 256 ) :: gages_list_file = ' '
129
129
real (r8 ) :: obs_fraction_for_error = 0.01
130
+ logical :: assimilate_all = .false.
130
131
integer :: debug = 0
131
132
132
133
namelist / create_identity_streamflow_obs_nml / &
@@ -135,6 +136,7 @@ program create_identity_streamflow_obs
135
136
location_file, &
136
137
gages_list_file, &
137
138
obs_fraction_for_error, &
139
+ assimilate_all, &
138
140
debug
139
141
140
142
!- ------------------------------------------------------------------------------
@@ -209,7 +211,12 @@ program create_identity_streamflow_obs
209
211
call init_obs(obs, num_copies= NUM_COPIES, num_qc= NUM_QC)
210
212
call init_obs(prev_obs, num_copies= NUM_COPIES, num_qc= NUM_QC)
211
213
212
- n_wanted_gages = set_desired_gages(gages_list_file)
214
+ ! Collect all the gauges:
215
+ ! - desired ones will have the provided obs_err_sd
216
+ ! - remaining gauges are dummy with very large obs_err_sd
217
+
218
+ n_desired_gages = set_desired_gages(gages_list_file)
219
+ n_wanted_gages = 0 ! set_desired_gages(gages_list_file)
213
220
call find_textfile_dims(input_files, nfiles)
214
221
215
222
num_new_obs = estimate_total_obs_count(input_files, nfiles)
@@ -308,7 +315,8 @@ program create_identity_streamflow_obs
308
315
309
316
OBSLOOP: do n = 1 , nobs
310
317
311
- if ( discharge(n) < 0.0_r8 ) cycle OBSLOOP
318
+ ! make sure discharge is physical
319
+ if ( discharge(n) < 0.0_r8 .or. discharge(n) /= discharge(n) ) cycle OBSLOOP
312
320
313
321
! relate the TimeSlice:station to the RouteLink:gage so we can
314
322
! determine the location
@@ -318,13 +326,13 @@ program create_identity_streamflow_obs
318
326
! relate the physical location to the dart state vector index
319
327
dart_index = linkloc_to_dart(lat(indx), lon(indx))
320
328
321
- ! oerr is the observation error standard deviation in this application.
322
- ! The observation error variance encoded in the observation file
323
- ! will be oerr*oerr
324
- oerr = max (discharge(n)* obs_fraction_for_error, MIN_OBS_ERR_STD)
325
-
326
- ! MEG: A fix to not crush the ensemble in a no-flood period (stagnant water).
327
- ! if ( discharge(n) < NORMAL_FLOW ) then
329
+ ! desired gauges get the provided obs_err
330
+ ! remaining ones are for verification purposes
331
+ if ( ANY (desired_gages == station_strings(n)) .or. assimilate_all) then
332
+ oerr = max (discharge(n)* obs_fraction_for_error, MIN_OBS_ERR_STD)
333
+ else
334
+ oerr = MAX_OBS_ERR_STD
335
+ endif
328
336
! don't correct that much, the gauge observations imply that the flow
329
337
! in the stream is small. This is not a flood period. Streamflow values
330
338
! indicate a more or less lake situation rather than a strongly flowing stream.
@@ -660,9 +668,9 @@ function estimate_total_obs_count(file_list,nfiles) result (num_obs)
660
668
661
669
! We need to know how many observations there may be.
662
670
! Specifying too many is not really a problem.
663
- ! I am adding 20%
671
+ ! I am multiplying by 10.
664
672
665
- num_obs = 1.2_r8 * nobs * nfiles
673
+ num_obs = 10.0_r8 * nobs * nfiles
666
674
667
675
end function estimate_total_obs_count
668
676
0 commit comments