Skip to content

Commit 7e46245

Browse files
authored
Variable observation error for local filters (#18)
multierr / hetereogeneous observation error See documentation of `obserr_clm`: https://hpscterrsys.github.io/pdaf/users_guide/running_tsmp_pdaf/input_obs.html#obserr-clm
1 parent 3ad6f8a commit 7e46245

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

interface/framework/prodrinva_l_pdaf.F90

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ SUBROUTINE prodRinvA_l_pdaf(domain_p, step, dim_obs_l, rank, obs_l, A_l, C_l)
5252
! !USES:
5353
USE mod_assimilation, &
5454
ONLY: cradius, locweight, sradius, obs_index_p, &
55-
rms_obs, distance
55+
rms_obs, distance
56+
USE mod_assimilation, ONLY: obs_index_l
5657
USE mod_parallel_pdaf, &
5758
ONLY: mype_filter
59+
USE mod_read_obs, ONLY: multierr
60+
USE mod_read_obs, ONLY: clm_obserr
61+
USE mod_read_obs, ONLY: pressure_obserr
5862

5963
IMPLICIT NONE
6064

@@ -192,13 +196,31 @@ SUBROUTINE prodRinvA_l_pdaf(domain_p, step, dim_obs_l, rank, obs_l, A_l, C_l)
192196
! ********************
193197
! *** Apply weight ***
194198
! ********************
199+
SELECT CASE (multierr)
200+
CASE(0)
195201

196202
DO j = 1, rank
197203
DO i = 1, dim_obs_l
198204
C_l(i, j) = ivariance_obs * weight(i) * A_l(i, j)
199205
END DO
200206
END DO
201207

208+
CASE(1)
209+
210+
DO j = 1, rank
211+
DO i = 1, dim_obs_l
212+
#if defined CLMSA
213+
! OBS_INDEX_L: returns NC-ordered index
214+
! CLM_OBSERR: NC-ordered array
215+
C_l(i, j) = 1.0/(clm_obserr(obs_index_l(i))*clm_obserr(obs_index_l(i))) * weight(i) * A_l(i, j)
216+
#else
217+
C_l(i, j) = 1.0/(pressure_obserr(obs_index_l(i))*pressure_obserr(obs_index_l(i))) * weight(i) * A_l(i, j)
218+
#endif
219+
END DO
220+
END DO
221+
222+
END SELECT
223+
202224
! *** Clean up ***
203225
DEALLOCATE(weight)
204226

0 commit comments

Comments
 (0)