Update SpcCoeff_Binary_IO.f90#43
Merged
BenjaminTJohnson merged 1 commit intofeature/btj_REL-2.4.0_emc_convert_tests_to_cmakefrom Sep 19, 2023
Merged
Update SpcCoeff_Binary_IO.f90#43BenjaminTJohnson merged 1 commit intofeature/btj_REL-2.4.0_emc_convert_tests_to_cmakefrom
BenjaminTJohnson merged 1 commit intofeature/btj_REL-2.4.0_emc_convert_tests_to_cmakefrom
Conversation
Fix version numbers for read
Collaborator
|
Thanks @ADCollard ! I appreciate your help in getting this sorted. I'll test now and get back shortly. |
cd25495
into
feature/btj_REL-2.4.0_emc_convert_tests_to_cmake
BenjaminTJohnson
added a commit
to JCSDA/CRTMv3
that referenced
this pull request
Aug 20, 2024
BenjaminTJohnson
added a commit
to JCSDA/CRTMv3
that referenced
this pull request
Aug 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix version numbers for read
There is a bug in SpcCoeff_Binary_IO.f90. Specifically these lines:
IF( dummy%Version > 2 ) THEN
! Binary coefficient version 3 introduced for TROPICS instrument.
! The SpcCoeff coefficients contain 'PolAngle' as an additional
! array.
READ ( fid, IOSTAT=io_stat, IOMSG=io_msg ) &
SpcCoeff%Sensor_Channel , &
SpcCoeff%Polarization , &
SpcCoeff%PolAngle , &
SpcCoeff%Channel_Flag , &
SpcCoeff%Frequency , &
SpcCoeff%Wavenumber , &
SpcCoeff%Planck_C1 , &
SpcCoeff%Planck_C2 , &
SpcCoeff%Band_C1 , &
SpcCoeff%Band_C2 , &
SpcCoeff%Cosmic_Background_Radiance, &
SpcCoeff%Solar_Irradiance
ELSE IF( dummy%Version < 3 ) THEN
! Version 2 is the default binary SpcCoeff version for
! REL-2.4.0 and older.
READ ( fid, IOSTAT=io_stat, IOMSG=io_msg ) &
SpcCoeff%Sensor_Channel , &
SpcCoeff%Polarization , &
SpcCoeff%Channel_Flag , &
SpcCoeff%Frequency , &
SpcCoeff%Wavenumber , &
SpcCoeff%Planck_C1 , &
SpcCoeff%Planck_C2 , &
SpcCoeff%Band_C1 , &
SpcCoeff%Band_C2 , &
SpcCoeff%Cosmic_Background_Radiance, &
SpcCoeff%Solar_Irradiance
Most of the versions in fix/SpcCoeff/Big_Endian are 8.02 or (for ATMS_N21) 8.04, but amsua_metop-b is version 8.03, so dummy%Version=3. This file does not contain PolAngle, which is why the code crashes.
The comment says that version 3 should include this field, so I do not know which is right. But changing dummy%Version > 2 to dummy%Version > 3 allows the file to be read in.
Also not that the IF( dummy%Version < 4 ) does not actually do anything (this will always be true).