Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sfcship (q, tsen, p) validation and QC flowcharts #82

Open
azadeh-gh opened this issue Jul 27, 2023 · 31 comments
Open

sfcship (q, tsen, p) validation and QC flowcharts #82

azadeh-gh opened this issue Jul 27, 2023 · 31 comments
Assignees

Comments

@azadeh-gh
Copy link

azadeh-gh commented Jul 27, 2023

Review current use of sfcship_p, sfcship_tsen, and sfcship_q and add a test YAMLs to parm/atm/obs/testing in GDASApp to reproduce the GSI (HofX and QC)

@azadeh-gh azadeh-gh self-assigned this Jul 27, 2023
@azadeh-gh
Copy link
Author

azadeh-gh commented Jul 27, 2023

sfcship_tsen Yaml

obs space:
name: sfcship
obsdatain:
engine:
type: H5File
obsfile: !ENV sfcship_obs_${CDATE}.nc4
obsdataout:
engine:
type: H5File
obsfile: !ENV sfcship_diag_${CDATE}.nc4
overwrite: true
simulated variables: [stationPressure, airTemperature, specificHumidity]
geovals:
filename: !ENV sfcship_geoval_${CDATE}.nc4

obs operator:
name: Composite
components:
- name: VertInterp
variables:
- name: airTemperature
- name: specificHumidity
vertical coordinate: air_pressure
observation vertical coordinate: pressure
- name: SfcPCorrected
variables:
- name: stationPressure
da_psfc_scheme: GSI
geovar_sfc_geomz: surface_altitude
geovar_geomz: geopotential_height
linear obs operator:
name: Identity

obs post filters:

1. Observation range sanity check

  • filter: Bounds Check
    filter variables:
    • name: airTemperature
      minvalue: 195
      maxvalue: 327
      action:
      name: reject

2. Reject all ObsType 183

  • filter: RejectList
    where:
    • variable:
      name: ObsType/airTemperature
      is_in: 183

3. Reject data based on PreQC

  • filter: PreQC
    minvalue: 0
    maxvalue: 15
    action:
    name: reject

4. Inflate obs error based on obs type

  • filter: Perform Action
    filter variables:
    • name: stationPressure
      where:
    • variable: PreQC/airTemperature
      is_in: 3, 7
      action:
      name: inflate error
      inflation factor: 1.2

5. Calculate obs error inflation factors for duplicated observations at the same location

  • filter: Variable Assignment
    assignments:
    • name: ObsErrorFactorDuplicateCheck/airTemperature
      type: float
      function:
      name: ObsFunction/ObsErrorFactorDuplicateCheck
      options:
      use_air_pressure: true
      variable: airTemperature

6. error inflation based on vertical spacing (subroutine errormod in qcmod.f90) for airTemperature and specific humidity

  • filter: Perform Action
    filter variables:
    • name: airTemperature
      action:
      name: inflate error
      inflation variable:
      name: ObsFunction/ObsErrorFactorConventional
      options:
      pressure: ObsValue/stationPressure
      test QCflag: PreQC
      test QCthreshold: 4
      inflate variables: [airTemperature]

7. gross check based on QM

  • filter: Background Check
    filter variables:

    • name: airTemperature
      absolute threshold: 4.9
      where:
    • variable:
      name: PreQC/airTemperature
      is_in: 3
  • filter: Background Check
    filter variables:

    • name: airTemperature
      absolute threshold: 7.0
      where:
    • variable:
      name: PreQC/airTemperature
      is_not_in: 3

8. Inflate obs error based on duplicate check

  • filter: Perform Action
    filter variables:
    • name: airTemperature
      action:
      name: inflate error
      inflation variable:
      name: ObsErrorFactorDuplicateCheck/airTemperature

image

@azadeh-gh
Copy link
Author

azadeh-gh commented Jul 27, 2023

Results from run_ufo_hofx_test.sh

hofxdiff_histogram_sfcship_tsen_diag_2021080100_sfcship_ps_airTemperature
gsi_hofx_vs_jedi_hofx_sfcship_tsen_diag_2021080100_sfcship_ps_airTemperature
errordiff_histogram_sfcship_tsen_diag_2021080100_sfcship_ps_airTemperature
gsi_omb_vs_jedi_omb_sfcship_tsen_diag_2021080100_sfcship_tsen_airTemperature

@azadeh-gh
Copy link
Author

azadeh-gh commented Jul 28, 2023

QC count check
gsi_hofx_vs_obs_sfcship_tsen_diag_2021080100_sfcship_tsen_airTemperature

EffectiveQC_map_sfcship_tsen_diag_2021080100_sfcship_tsen_airTemperature
GsiEffectiveQC_map_sfcship_tsen_diag_2021080100_sfcship_tsen_airTemperature
PreQC_map_sfcship_tsen_diag_2021080100_sfcship_tsen_airTemperature

sfcship_tsen_JEDIvsGSIqc

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 2, 2023

gsi_hofx_vs_jedi_hofx_sfcship_diag_2021080100_sfcship_stationPressure
gsi_hofx_vs_obs_sfcship_diag_2021080100_sfcship_stationPressure

gsi_omb_vs_jedi_omb_sfcship_diag_2021080100_sfcship_stationPressure

hofxdiff_map_sfcship_diag_2021080100_sfcship_stationPressure

errordiff_histogram_sfcship_diag_2021080100_sfcship_stationPressure

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 2, 2023

EffectiveQC_map_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

GsiEffectiveQC_map_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

PreQC_map_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

sfcship_q_JEDIvsGSIqc

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 2, 2023

gsi_hofx_vs_jedi_hofx_sfcship_q_diag_2021080100_sfcship_q_specificHumidity
hofxdiff_histogram_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

@azadeh-gh
Copy link
Author

gsi_hofx_vs_obs_sfcship_q_diag_2021080100_sfcship_q_specificHumidity
jedi_hofx_vs_obs_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

@azadeh-gh
Copy link
Author

gsi_omb_vs_jedi_omb_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

@azadeh-gh
Copy link
Author

hofxdiff_map_sfcship_q_diag_2021080100_sfcship_q_specificHumidity

@azadeh-gh
Copy link
Author

To check the HofX values. I selected a location that the JEDI-GSI_HofX was non zero(-0.000335):
hofx=0.008216
obsValue: 0.011418
GSIHofX= 0.0085511
Pressure: 101660
lat=-22.6
lon=11.4
From the geoval file this value is between 101733.3 and 101473.9 air_pressure value
Linear interpolation between two points is as follows:
Given two points (x1, y1) and (x2, y2), the value of y at some point x is given by the equation:
y = y1 + ((y2 - y1) / (x2 - x1)) * (x - x1)

y is specific humidity and x is pressure
y1 = 0.008551092
x1 = 101733.3
y2 = 0.007364262
x2 = 101473.9
x = 101660

y = y1 + ((y2 - y1) / (x2 - x1)) * (x - x1)

y= 0.008215723306861987

So base on this value the JEDI HofX 0.008216 is more accurate

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 7, 2023

Checking the values for sfcship_tsen, showed that the pressure value is always higher than air_pressure value in the geoval file, for each location. So the values of JEDI and GSI HofX are as same as the first air_temperature value in the geoval file.
Example:
hofx=298.6753
obsValue:300.15
GSIHofX= 298.6753
Pressure: 101360
lat=-10.3
lon=142.2
air_pressure (geoval)=101258
air_temperature (geoval)=298.6753

@ADCollard
Copy link

ADCollard commented Aug 8, 2023

@azadeh-gh Thanks for doing this! So JEDI seems to be closer.

Just for completeness, I did the same calculation for Ln(p). The result is very close:

 y = y1 + ((y2 - y1) / (np.log(x2) - np.log(x1))) * (np.log(x) - np.log(x1))

In [14]: y
Out[14]: 0.008216030328678606

The GSI value just seems to be y1. I guess that is what we were finding on Thursday?

@azadeh-gh
Copy link
Author

Correct, on Thursday we found that if we use surface_pressure for sfcship_q (that is the first value of air_pressure_level for each location in geoval file) the JEDI HofX will be equal to GSI HofX. But using air_pressure the HofX values will be different.
Now we know that using air_pressure from geoval the JEDI values are linear interpolation and GSI are y1.
We did not see this difference in sfcship_tsen because both GSI and JEDI HofX are equal to y1 (the first air_temperature value for each location in geoval file).

@azadeh-gh
Copy link
Author

SFCSHIP

gsi_hofx_vs_jedi_hofx_sfcship_diag_2021080100_sfcship_airTemperature
gsi_hofx_vs_jedi_hofx_sfcship_diag_2021080100_sfcship_specificHumidity
gsi_hofx_vs_jedi_hofx_sfcship_diag_2021080100_sfcship_stationPressure
gsi_hofx_vs_obs_sfcship_diag_2021080100_sfcship_airTemperature
gsi_hofx_vs_obs_sfcship_diag_2021080100_sfcship_specificHumidity
gsi_hofx_vs_obs_sfcship_diag_2021080100_sfcship_stationPressure

@azadeh-gh
Copy link
Author

hofxdiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature
hofxdiff_histogram_sfcship_diag_2021080100_sfcship_specificHumidity
hofxdiff_histogram_sfcship_diag_2021080100_sfcship_stationPressure

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 29, 2023

errordiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature

errordiff_histogram_sfcship_diag_2021080100_sfcship_specificHumidity

errordiff_histogram_sfcship_diag_2021080100_sfcship_stationPressure

@CoryMartin-NOAA
Copy link
Contributor

100,000,000 Kelvin is quite the error difference! Did this ship make it to the center of the sun?

@ADCollard
Copy link

@azadeh-gh What are we looking at here? Have you modified the YAMLs to agree with the GSI? Did you produce a new flowchart?

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 29, 2023

Yes, above plots are related to the modified YAMLs, base on Emily's QCflowcharts for sfcship_ps

image

@ADCollard
Copy link

@azadeh-gh So the usual background check filter does not work in this case?

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 30, 2023

errordiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature

@CoryMartin-NOAA
Copy link
Contributor

How are the obs error differences that large for temperature?

@ADCollard
Copy link

@azadeh-gh I don't see where you have done the error inflation

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 30, 2023

@CoryMartin-NOAA Because the YAML needs error inflation filter for airTemperature. The values of Effective Error are still 2.5 (GsiInitialObsError)

I added obserrorFactorConventional that is errormod subroutine in qcmod.f90
- filter: BlackList
filter variables:
- name: airTemperature
action:
name: inflate error
inflation variable:
name: ObsFunction/ObsErrorFactorConventional
options:
test QCflag: PreQC
inflate variables: [airTemperature]

But get below error:
Test "ufo/ObsFilters/testFilters" failed with unhandled exception: Reason: An exception occurred inside ioda while opening a variable.
name: ObsValue/pressure
source_column: 0
source_filename: /scratch1/NCEPDEV/da/Azadeh.Gholoubi/GDASApp/ioda/src/engines/ioda/src/ioda/Has_Variables.cpp
source_function: ioda::Variable ioda::detail::Has_Variables_Base::open(const std::__cxx11::basic_string<char, std::char_traits, std::allocator> &) const
source_line: 108

MetaData/pressure and ObsValue/stationPressure exist in the observation file, not ObsValue/pressure

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 30, 2023

obs space:
name: sfcship
obsdatain:
engine:
type: H5File
obsfile: !ENV sfcship_obs_${CDATE}.nc4
obsdataout:
engine:
type: H5File
obsfile: !ENV sfcship_diag_${CDATE}.nc4
overwrite: true
simulated variables: [stationPressure, airTemperature, specificHumidity]
geovals:
filename: !ENV sfcship_geoval_${CDATE}.nc4

obs operator:
name: Composite
components:
- name: VertInterp
variables:
- name: airTemperature
- name: specificHumidity
vertical coordinate: air_pressure
observation vertical coordinate: pressure
- name: SfcPCorrected
variables:
- name: stationPressure
da_psfc_scheme: GSI
geovar_sfc_geomz: surface_altitude
geovar_geomz: geopotential_height
linear obs operator:
name: Identity

obs post filters:

Observation range sanity check

  • filter: Bounds Check
    filter variables:
    • name: stationPressure
      minvalue: 37499.0
      maxvalue: 106999.0
      action:
      name: reject

Reject all ObsType 183

  • filter: RejectList
    where:
    • variable:
      name: ObsType/stationPressure
      is_in: 183

Reject surface pressure below 500 hPa

  • filter: Bounds Check
    filter variables:
    • name: stationPressure
      minvalue: 50000.00
      action:
      name: reject

Reject data based on PreQC

  • filter: PreQC
    minvalue: 0
    maxvalue: 15
    action:
    name: reject

Inflate obs error based on obs type

  • filter: Perform Action
    filter variables:
    • name: stationPressure
      where:
    • variable: PreQC/stationPressure
      is_in: 3, 7
      action:
      name: inflate error
      inflation factor: 1.2

Calculate obs error inflation factors for duplicated observations at the same location

  • filter: Variable Assignment
    assignments:
    • name: DerivedMetaData/ObsErrorFactorDuplicateCheck
      type: float
      function:
      name: ObsFunction/ObsErrorFactorDuplicateCheck
      options:
      use_air_pressure: false
      variable: stationPressure

Reduce effective observation error based on obs type and subtype

In this case: reduce effective obs error for buoy

  • filter: Perform Action
    filter variables:
    • name: stationPressure
      where:
    • variable:
      name: ObsType/stationPressure
      is_in: 180
    • variable:
      name: ObsSubType/stationPressure
      is_in: 0
      action:
      name: inflate error
      inflation factor: 0.7

Reduce original observation error based on obs type and subtype

In this case: reduce original obs error for buoy

  • filter: Variable Assignment
    where:
    • variable:
      name: ObsType/stationPressure
      is_in: 180
    • variable:
      name: ObsSubType/stationPressure
      is_in: 0
      assignments:
    • name: ObsError/stationPressure
      type: float
      function:
      name: ObsFunction/Arithmetic
      options:
      variables:
      - name: ObsError/stationPressure
      coefs: [0.7]

Inflate surface pressure observation based on discrepancies between

model and observations due to terrian

  • filter: Perform Action
    filter variables:
    • name: stationPressure
      action:
      name: inflate error
      inflation variable:
      name: ObsFunction/ObsErrorFactorSfcPressure
      options:
      geovar_sfc_geomz: surface_altitude

Gross check based on residuals

  • filter: Background Check
    filter variables:

    • name: stationPressure
      absolute threshold: 3500
      where:
    • variable:
      name: PreQC/stationPressure
      is_in: 3
  • filter: Background Check
    filter variables:

    • name: stationPressure
      absolute threshold: 5000
      where:
    • variable:
      name: PreQC/stationPressure
      is_not_in: 3

Inflate obs error based on duplicate check

  • filter: Perform Action
    filter variables:
    • name: stationPressure
      action:
      name: inflate error
      inflation variable:
      name: DerivedMetaData/ObsErrorFactorDuplicateCheck

@azadeh-gh
Copy link
Author

azadeh-gh commented Aug 30, 2023

@ADCollard above is my sfcship.yaml , it doesn't have any error inflation for airTemperature.

@emilyhcliu
Copy link

Here is the updated QC flowchart for PSOB SFCSHIP

@azadeh-gh
Copy link
Author

image

@azadeh-gh
Copy link
Author

QC flowcharts

@emilyhcliu
Copy link

emilyhcliu commented Sep 12, 2023

@CoryMartin-NOAA @ADCollard @azadeh-gh

  • I have the station pressure QC work done for obs types 180, 181, 183, 187, and 120. (Combination of SFC, SFCSHIP and ADPUPA (POB at the surface only from ADPUPA).
  • The results can 100% replicate GSI results in terms of data count and final observation errors
  • I will document the results here (still work in progress)

@azadeh-gh
Copy link
Author

Commenting out the duplicate check in GSI changed the sfcship_tsen JEDI-GSI obs error from A to B

A: With duplicate check in GSI

errordiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature

B: Without duplicate check in GSI

errordiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature

Also evaluated the updated sfcship.yaml from GMAO.

errordiff_histogram_sfcship_diag_2021080100_sfcship_airTemperature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants