When creating varobs in OPS, there are VarFields for which Ops_VarobPGEs expects PGEs to be in packed form. These packed values have typically been updated via the background check and packed in the form:
element(J) % PGEFinal = AINT (PGEBk * PPF) + element(J) % PGEFinal ! Packing of PGEs
where PPF = 1000.0 and AINT truncates to an integer. This allows an initial PGE value to be stored as the fractional part. For example, an initial PGE of 0.10 and updated PGE value of 0.4215156 are packed as 421.1
Ops_VarobPGEs accounts for these VarFields by unpacking the PGE values before writing to varobs (as PGE x 10000).
Opsinputs expects to receive PGE values which are unpacked. Routine opsinputs_fill_mod then packs the PGE values for the required varfields to account for the fact Ops_VarobPGEs will then unpack them before writing. For PGE values that are updated e.g. via the Bayesian Background Check, we need to ensure the truncation is handled properly such that the values output to varobs match those output from OPS.
For example, a Satwind eastward_wind observation has a PGE value of 0.4215156 after applying the Bayesian Background Check filter in ufo. At present, opsinputs_fill_mod will pack this as 422:
Element % PGEFinal = Element % PGEFinal * PPF
Element % PGEFinal = NINT(Element % PGEFinal)
And then write to varobs as 4220.
In OPS this is written to varobs as 4210.
If we want this to match, then we need to handle the truncation appropriately.
When creating varobs in OPS, there are VarFields for which Ops_VarobPGEs expects PGEs to be in packed form. These packed values have typically been updated via the background check and packed in the form:
element(J) % PGEFinal = AINT (PGEBk * PPF) + element(J) % PGEFinal ! Packing of PGEs
where PPF = 1000.0 and AINT truncates to an integer. This allows an initial PGE value to be stored as the fractional part. For example, an initial PGE of 0.10 and updated PGE value of 0.4215156 are packed as 421.1Ops_VarobPGEs accounts for these VarFields by unpacking the PGE values before writing to varobs (as PGE x 10000).
Opsinputs expects to receive PGE values which are unpacked. Routine opsinputs_fill_mod then packs the PGE values for the required varfields to account for the fact Ops_VarobPGEs will then unpack them before writing. For PGE values that are updated e.g. via the Bayesian Background Check, we need to ensure the truncation is handled properly such that the values output to varobs match those output from OPS.
For example, a Satwind eastward_wind observation has a PGE value of 0.4215156 after applying the Bayesian Background Check filter in ufo. At present, opsinputs_fill_mod will pack this as 422:
And then write to varobs as 4220.
In OPS this is written to varobs as 4210.
If we want this to match, then we need to handle the truncation appropriately.