Skip to content

Hotfix/cd emis kmtx#221

Merged
BenjaminTJohnson merged 7 commits into
developfrom
hotfix/cd_emis_kmtx
Jun 24, 2025
Merged

Hotfix/cd emis kmtx#221
BenjaminTJohnson merged 7 commits into
developfrom
hotfix/cd_emis_kmtx

Conversation

@chengdang
Copy link
Copy Markdown
Contributor

@chengdang chengdang commented Apr 2, 2025

Description

Surface emissivity Jacobian bug fix PR

Issue(s) addressed

Resolves #217

Dependencies

None

Impact

Expect changes in value of surface emissivity Jacobians
Know impacts on qc tests

Checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have run the unit tests before creating the PR

Minor modification to CRTM test: including amusa test over water covered
surface
@chengdang chengdang added the needs review Asking others to review - often used for pull requests label Apr 2, 2025
@chengdang chengdang self-assigned this Apr 2, 2025
@chengdang
Copy link
Copy Markdown
Contributor Author

chengdang commented Apr 2, 2025

Note that commit 964e34e reverted the changes to surface types.
All unit tests passed in comparison to the results generated by dev branch (except for surface emissivity Jacobians)

@BenjaminTJohnson
Copy link
Copy Markdown
Contributor

When I compare to develop, I get

         91 - test_k_matrix_Simple_cris-fsr_n21 (Failed)
         92 - test_k_matrix_Simple_v.abi_g18 (Failed)
         93 - test_k_matrix_Simple_atms_npp (Failed)
         94 - test_k_matrix_Simple_cris399_npp (Failed)
         95 - test_k_matrix_Simple_v.abi_gr (Failed)
         96 - test_k_matrix_Simple_abi_g18 (Failed)
         97 - test_k_matrix_Simple_modis_aqua (Failed)
        104 - test_k_matrix_Zeeman_ssmis_f20 (Failed)
        105 - test_k_matrix_Zeeman_ssmis_f19 (Failed)
        106 - test_k_matrix_Zeeman_ssmis_f18 (Failed)
        107 - test_k_matrix_Zeeman_ssmis_f17 (Failed)
        108 - test_k_matrix_Zeeman_ssmis_f16 (Failed)
        109 - test_k_matrix_ChannelSubset_iasi_metop-b (Failed)
        110 - test_k_matrix_ClearSky_atms_n21 (Failed)
        111 - test_k_matrix_ClearSky_cris-fsr_n21 (Failed)
        113 - test_k_matrix_ClearSky_atms_npp (Failed)
        114 - test_k_matrix_ClearSky_cris399_npp (Failed)
        116 - test_k_matrix_ClearSky_abi_g18 (Failed)
        117 - test_k_matrix_ClearSky_modis_aqua (Failed)
        118 - test_k_matrix_ScatteringSwitch_atms_n21 (Failed)
        119 - test_k_matrix_ScatteringSwitch_cris-fsr_n21 (Failed)
        121 - test_k_matrix_ScatteringSwitch_atms_npp (Failed)
        122 - test_k_matrix_ScatteringSwitch_cris399_npp (Failed)
        124 - test_k_matrix_ScatteringSwitch_abi_g18 (Failed)
        125 - test_k_matrix_ScatteringSwitch_modis_aqua (Failed)
        134 - test_k_matrix_SOI_atms_n21 (Failed)
        135 - test_k_matrix_SOI_cris-fsr_n21 (Failed)
        137 - test_k_matrix_SOI_atms_npp (Failed)
        138 - test_k_matrix_SOI_cris399_npp (Failed)
        140 - test_k_matrix_SOI_abi_g18 (Failed)
        141 - test_k_matrix_SOI_modis_aqua (Failed)
        142 - test_k_matrix_SSU_ssu_n06 (Failed)
        143 - test_k_matrix_SSU_ssu_n14 (Failed)
        152 - test_adjoint_Simple_atms_n21 (Failed)
        155 - test_adjoint_Simple_atms_npp (Failed)
        160 - test_adjoint_ClearSky_atms_n21 (Failed)
        161 - test_adjoint_ClearSky_cris-fsr_n21 (Failed)
        163 - test_adjoint_ClearSky_atms_npp (Failed)
        164 - test_adjoint_ClearSky_cris399_npp (Failed)
        166 - test_adjoint_ClearSky_abi_g18 (Failed)
        167 - test_adjoint_ClearSky_modis_aqua (Failed)
[s4-submit] /data/users/bjohnson/CRTM/CRTMv3/build> ctest --rerun-failed --output-on-failure | grep "FAILURE"
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Zeeman(FAILURE) : RTSolution_K results are different!
 test_Zeeman(FAILURE) : RTSolution_K results are different!
 test_Zeeman(FAILURE) : RTSolution_K results are different!
 test_Zeeman(FAILURE) : RTSolution_K results are different!
 test_Zeeman(FAILURE) : RTSolution_K results are different!
 Example6_ChannelSubset(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ClearSky(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_ScatteringSwitch(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SOI(FAILURE) : RTSolution_K results are different!
 test_SSU(FAILURE) : RTSolution_K results are different!
 test_SSU(FAILURE) : RTSolution_K results are different!
 test_Simple(FAILURE) : RTSolution_AD results are different!
 test_Simple(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!
 test_ClearSky(FAILURE) : RTSolution_AD results are different!

@chengdang
Copy link
Copy Markdown
Contributor Author

chengdang commented Apr 3, 2025

Good catch. Yes. I forgot to add that a lot k-matrix/ad tests should fail with the updated surface emissivity Jacobians.

Mostly for variable: RTSolution_K%Surface_Emissivity and RTSolution_AD%Surface_Emissivity

Here is a list of failed test from my end:

76% tests passed, 46 tests failed out of 191

Label Time Summary:
CRTM_Tests    = 174.35 sec*proc (191 tests)

Total Test time (real) = 177.72 sec

The following tests FAILED:
	 91 - test_k_matrix_Simple_atms_n21 (Failed)
	 92 - test_k_matrix_Simple_cris-fsr_n21 (Failed)
	 93 - test_k_matrix_Simple_v.abi_g18 (Failed)
	 94 - test_k_matrix_Simple_atms_npp (Failed)
	 95 - test_k_matrix_Simple_cris399_npp (Failed)
	 96 - test_k_matrix_Simple_v.abi_gr (Failed)
	 97 - test_k_matrix_Simple_abi_g18 (Failed)
	 98 - test_k_matrix_Simple_modis_aqua (Failed)
	106 - test_k_matrix_Zeeman_ssmis_f20 (Failed)
	107 - test_k_matrix_Zeeman_ssmis_f19 (Failed)
	108 - test_k_matrix_Zeeman_ssmis_f18 (Failed)
	109 - test_k_matrix_Zeeman_ssmis_f17 (Failed)
	110 - test_k_matrix_Zeeman_ssmis_f16 (Failed)
	111 - test_k_matrix_ChannelSubset_iasi_metop-b (Failed)
	112 - test_k_matrix_ClearSky_atms_n21 (Failed)
	113 - test_k_matrix_ClearSky_cris-fsr_n21 (Failed)
	115 - test_k_matrix_ClearSky_atms_npp (Failed)
	116 - test_k_matrix_ClearSky_cris399_npp (Failed)
	118 - test_k_matrix_ClearSky_abi_g18 (Failed)
	119 - test_k_matrix_ClearSky_modis_aqua (Failed)
	120 - test_k_matrix_ScatteringSwitch_atms_n21 (Failed)
	121 - test_k_matrix_ScatteringSwitch_cris-fsr_n21 (Failed)
	123 - test_k_matrix_ScatteringSwitch_atms_npp (Failed)
	124 - test_k_matrix_ScatteringSwitch_cris399_npp (Failed)
	126 - test_k_matrix_ScatteringSwitch_abi_g18 (Failed)
	127 - test_k_matrix_ScatteringSwitch_modis_aqua (Failed)
	136 - test_k_matrix_SOI_atms_n21 (Failed)
	137 - test_k_matrix_SOI_cris-fsr_n21 (Failed)
	138 - test_k_matrix_SOI_v.abi_g18 (Failed)
	139 - test_k_matrix_SOI_atms_npp (Failed)
	140 - test_k_matrix_SOI_cris399_npp (Failed)
	141 - test_k_matrix_SOI_v.abi_gr (Failed)
	142 - test_k_matrix_SOI_abi_g18 (Failed)
	143 - test_k_matrix_SOI_modis_aqua (Failed)
	144 - test_k_matrix_SSU_ssu_n06 (Failed)
	145 - test_k_matrix_SSU_ssu_n14 (Failed)
	154 - test_adjoint_Simple_atms_n21 (Failed)
	156 - test_adjoint_Simple_v.abi_g18 (Failed)
	157 - test_adjoint_Simple_atms_npp (Failed)
	159 - test_adjoint_Simple_v.abi_gr (Failed)
	163 - test_adjoint_ClearSky_atms_n21 (Failed)
	164 - test_adjoint_ClearSky_cris-fsr_n21 (Failed)
	166 - test_adjoint_ClearSky_atms_npp (Failed)
	167 - test_adjoint_ClearSky_cris399_npp (Failed)
	169 - test_adjoint_ClearSky_abi_g18 (Failed)
	170 - test_adjoint_ClearSky_modis_aqua (Failed)

@chengdang
Copy link
Copy Markdown
Contributor Author

chengdang commented Apr 3, 2025

Could you add which tests are reporting these failures?

 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!
 test_Simple(FAILURE) : Atmosphere_K Jacobians are different!

All my tests failed due to RTSolution_K results are different!

@BenjaminTJohnson
Copy link
Copy Markdown
Contributor

         90 - test_k_matrix_Simple_atms_n21 (Failed)
         91 - test_k_matrix_Simple_cris-fsr_n21 (Failed)
         92 - test_k_matrix_Simple_v.abi_g18 (Failed)
         93 - test_k_matrix_Simple_atms_npp (Failed)
         94 - test_k_matrix_Simple_cris399_npp (Failed)
         95 - test_k_matrix_Simple_v.abi_gr (Failed)
         96 - test_k_matrix_Simple_abi_g18 (Failed)
         97 - test_k_matrix_Simple_modis_aqua (Failed)
        104 - test_k_matrix_Zeeman_ssmis_f20 (Failed)
        105 - test_k_matrix_Zeeman_ssmis_f19 (Failed)
        106 - test_k_matrix_Zeeman_ssmis_f18 (Failed)
        107 - test_k_matrix_Zeeman_ssmis_f17 (Failed)
        108 - test_k_matrix_Zeeman_ssmis_f16 (Failed)
        109 - test_k_matrix_ChannelSubset_iasi_metop-b (Failed)
        110 - test_k_matrix_ClearSky_atms_n21 (Failed)
        111 - test_k_matrix_ClearSky_cris-fsr_n21 (Failed)
        113 - test_k_matrix_ClearSky_atms_npp (Failed)
        114 - test_k_matrix_ClearSky_cris399_npp (Failed)
        116 - test_k_matrix_ClearSky_abi_g18 (Failed)
        117 - test_k_matrix_ClearSky_modis_aqua (Failed)
        118 - test_k_matrix_ScatteringSwitch_atms_n21 (Failed)
        119 - test_k_matrix_ScatteringSwitch_cris-fsr_n21 (Failed)
        121 - test_k_matrix_ScatteringSwitch_atms_npp (Failed)
        122 - test_k_matrix_ScatteringSwitch_cris399_npp (Failed)
        124 - test_k_matrix_ScatteringSwitch_abi_g18 (Failed)
        125 - test_k_matrix_ScatteringSwitch_modis_aqua (Failed)
        134 - test_k_matrix_SOI_atms_n21 (Failed)
        135 - test_k_matrix_SOI_cris-fsr_n21 (Failed)
        137 - test_k_matrix_SOI_atms_npp (Failed)
        138 - test_k_matrix_SOI_cris399_npp (Failed)
        140 - test_k_matrix_SOI_abi_g18 (Failed)
        141 - test_k_matrix_SOI_modis_aqua (Failed)
        142 - test_k_matrix_SSU_ssu_n06 (Failed)
        143 - test_k_matrix_SSU_ssu_n14 (Failed)
        152 - test_adjoint_Simple_atms_n21 (Failed)
        155 - test_adjoint_Simple_atms_npp (Failed)
        160 - test_adjoint_ClearSky_atms_n21 (Failed)
        161 - test_adjoint_ClearSky_cris-fsr_n21 (Failed)
        163 - test_adjoint_ClearSky_atms_npp (Failed)
        164 - test_adjoint_ClearSky_cris399_npp (Failed)
        166 - test_adjoint_ClearSky_abi_g18 (Failed)
        167 - test_adjoint_ClearSky_modis_aqua (Failed)

@BenjaminTJohnson
Copy link
Copy Markdown
Contributor

I also wonder why some of the _AD tests pass, some fail.

@chengdang
Copy link
Copy Markdown
Contributor Author

chengdang commented Apr 3, 2025

I also wonder why some of the _AD tests pass, some fail.

It is also due to surface emissivity bug fix in function Assign_Common_Output_AD. This is called by AD calculations well.

Most AD tests from my end failed, tests # 154-170. It seems our total number of tests are different (likely due to the added amsua_n19 from this branch, which brings a total of 191 tests from this branch). But some did pass, the same applies to K_matrix tests. Let me dig more

I don't see any Atmosphere_K Jacobians failures though

@chengdang
Copy link
Copy Markdown
Contributor Author

chengdang commented Apr 3, 2025

This is a list of k_matrix/AD tests that passed due to different reasons:

  1. Tests that passed for certain sensors.

a). The following tests passed due to Azimuth_Fourier_Loop setup discussed here #222 (comment)

  Test #114: test_k_matrix_ClearSky_v.abi_g18 
  Test #117: test_k_matrix_ClearSky_v.abi_gr
  Test #122: test_k_matrix_ScatteringSwitch_v.abi_g18 
  Test #125: test_k_matrix_ScatteringSwitch_v.abi_gr
  Test #165: test_adjoint_ClearSky_v.abi_g18 
  Test #168: test_adjoint_ClearSky_v.abi_gr 

b). The following tests passed because RTSolution_AD%Surface_Emissivity = SfcOptics_AD%Emissivity(SfcOptics_AD%Index_Sat_Ang,1) = 0, which is calculated by function CRTM_ADA_AD (emissivity_AD(1:nZ) = s_rad_up_AD(1:nZ) * RTV%Planck_Surface), in which the computed s_rad_up_AD(1:nZ) = 0.

  Test #155: test_adjoint_Simple_cris-fsr_n21 
  Test #158: test_adjoint_Simple_cris399_npp
  Test #160: test_adjoint_Simple_abi_g18
  Test #161: test_adjoint_Simple_modis_aqua

c). The following tests are newly introduced by this branch, therefore passed

​ Test​ #99: test_k_matrix_Simple_amsua_n19
 Test #162: test_adjoint_Simple_amsua_n19
  1. By design, K_matrix AOD tests do not check RTSolution_K.
  Test #100: test_k_matrix_AOD_cris-fsr_n21
  Test #101: test_k_matrix_AOD_v.abi_g18
  Test #102: test_k_matrix_AOD_cris399_npp
  Test #103: test_k_matrix_AOD_v.abi_gr
  Test #104: test_k_matrix_AOD_abi_g18
  Test #105: test_k_matrix_AOD_airs_aqua
  1. With user emissivity, we likely don't call the updated codes (CONFIRMED).
  Test #128: test_k_matrix_User_Emissivity_atms_n21
  Test #129: test_k_matrix_User_Emissivity_cris-fsr_n21
  Test #130: test_k_matrix_User_Emissivity_v.abi_g18
  Test #131: test_k_matrix_User_Emissivity_atms_npp
  Test #132: test_k_matrix_User_Emissivity_cris399_npp
  Test #133: test_k_matrix_User_Emissivity_v.abi_gr
  Test #134: test_k_matrix_User_Emissivity_abi_g18
  Test #135: test_k_matrix_User_Emissivity_modis_aqua
  1. By design, vertical coordinates tests do not check RTSoultion_K
  Test #146: test_k_matrix_VerticalCoordinates_atms_n21
  Test #147: test_k_matrix_VerticalCoordinates_cris-fsr_n21
  Test #148: test_k_matrix_VerticalCoordinates_v.abi_g18
  Test #149: test_k_matrix_VerticalCoordinates_atms_npp
  Test #150: test_k_matrix_VerticalCoordinates_cris399_npp
  Test #151: test_k_matrix_VerticalCoordinates_v.abi_gr
  Test #152: test_k_matrix_VerticalCoordinates_abi_g18
  Test #153: test_k_matrix_VerticalCoordinates_modis_aqua

@chengdang
Copy link
Copy Markdown
Contributor Author

@BenjaminTJohnson Please see the updated notes on why certain tests failed/passed.
Category 1.a requires an additional bug fix, as proposed here #222 (comment)

@liujake
Copy link
Copy Markdown

liujake commented May 6, 2025

Is there a timeline for fixing ctests and merging this PR into the develop?

@BenjaminTJohnson BenjaminTJohnson merged commit 8abded4 into develop Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Asking others to review - often used for pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CRTM surface emissivity Jacobian

3 participants