Skip to content

Commit 01c541d

Browse files
committed
additional documentation and minor cleanup for ASCAT soil moisture reader updates
1 parent 22feaf1 commit 01c541d

File tree

3 files changed

+35
-22
lines changed

3 files changed

+35
-22
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515

1616
### Changed
1717

18-
- Updated read_obs_sm_ASCAT_EUMET to work with both new and old filename formats.
18+
- Updated read_obs_sm_ASCAT_EUMET to work with both original and revised file name templates.
1919

2020
### Fixed
2121

GEOSlandassim_GridComp/clsm_ensupd_read_obs.F90

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,34 +1741,41 @@ subroutine read_obs_sm_ASCAT_EUMET( &
17411741
N_tmp = 0
17421742

17431743
do kk = 1,N_fnames
1744-
1744+
17451745
tmpfname = fname_list(kk)
1746-
1746+
17471747
! Are we in the required assimilation window?
17481748
!
1749+
! NOTE: EUMETSAT changed the file name template sometime in 2023 or 2024.
1750+
! There was no change to the file contents.
1751+
! Files from the original download (through data day ~1 Jun 2023) have
1752+
! the original file name template ("M0[X]-ASCA..."), more recently downloaded
1753+
! files have the revised template ("W_XX-EUMETSAT...").
1754+
! This reader accommodates both templates:
1755+
!
17491756
! e.g. Y2019/M07/M01-ASCA-ASCSMO02-NA-5.0-20190702075700.000000000Z-20190702084627-1350204.bfr
17501757
! Y2024/M02/W_XX-EUMETSAT-Darmstadt,SOUNDING+SATELLITE,METOPC+ASCAT_C_EUMR_20240229095700_27567_eps_o_250_ssm_l2.bin
17511758
!
17521759
! 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890
17531760
! 1 2 3 4 5 6 7 8 9 10 11 12
1754-
1755-
! Check if tmpfname contains "ASCA-ASCSMO02" or "W_XX-EUMETSAT", error if neither
1756-
1761+
1762+
! check if tmpfname contains "ASCA-ASCSMO02" or "W_XX-EUMETSAT", error if neither
1763+
17571764
if (index(tmpfname, "ASCA-ASCSMO02") /= 0) then
1758-
str_date_time = tmpfname(36:49)
1765+
str_date_time = tmpfname(36:49)
17591766
else if (index(tmpfname, "W_XX-EUMETSAT") /= 0) then
1760-
str_date_time = tmpfname(74:87)
1767+
str_date_time = tmpfname(74:87)
17611768
else
1762-
err_msg = 'Unknown ASCAT observation filename format'
1763-
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
1769+
err_msg = 'Unknown ASCAT observation file name format'
1770+
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
17641771
end if
17651772

1766-
! Check that str_date_time only contains numeric characters
1767-
1773+
! check if str_date_time only contains numeric characters
1774+
17681775
do ii = 1, len(trim(str_date_time))
17691776
if (ichar(str_date_time(ii:ii)) < ichar('0') .or. ichar(str_date_time(ii:ii)) > ichar('9')) then
1770-
err_msg = 'The date-time string parsed from the ASCAT observation filename contains non-numeric characters'
1771-
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
1777+
err_msg = 'Date-time string parsed from ASCAT sm obs file name contains non-numeric characters'
1778+
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
17721779
end if
17731780
end do
17741781

@@ -1779,15 +1786,15 @@ subroutine read_obs_sm_ASCAT_EUMET( &
17791786
read(str_date_time(11:12), *) date_time_tmp%min
17801787
read(str_date_time(13:14), *) date_time_tmp%sec
17811788

1782-
! Check if date_time_tmp%year and date_time_tmp%month and date_time_tmp%day are valid
1789+
! check if year, month, and day are valid
17831790

1784-
if (date_time_tmp%year < 1900 .or. date_time_tmp%year > 2100 .or. &
1785-
date_time_tmp%month < 1 .or. date_time_tmp%month > 12 .or. &
1786-
date_time_tmp%day < 1 .or. date_time_tmp%day > 31) then
1787-
err_msg = 'A valid date-time string has not been successfully parsed from the ASCAT observation filename'
1791+
if ( date_time_tmp%year < 2007 .or. date_time_tmp%year > 2100 .or. &
1792+
date_time_tmp%month < 1 .or. date_time_tmp%month > 12 .or. &
1793+
date_time_tmp%day < 1 .or. date_time_tmp%day > 31 ) then
1794+
err_msg = 'Could not parse valid date-time string from ASCAT obs file name'
17881795
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
1789-
end if
1790-
1796+
end if
1797+
17911798
if ( datetime_lt_refdatetime( date_time_low_fname, date_time_tmp ) .and. &
17921799
datetime_le_refdatetime( date_time_tmp, date_time_up ) ) then
17931800

GEOSldas_App/LDASsa_DEFAULT_inputs_ensupd.nml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2158,7 +2158,13 @@ obs_param_nml(48)%xcorr = 0.1875
21582158
obs_param_nml(48)%ycorr = 0.1875
21592159
obs_param_nml(48)%adapt = 0
21602160

2161-
! --------------------------------------------------------------------
2161+
! --------------------------------------------------------------------------------------------------------------
2162+
!
2163+
! ASCAT_MET[X]_SM soil moisture observations from EUMETSAT
2164+
!
2165+
! Leave %name blank. Provide text files that contain file names via %flistpath and %flistname.
2166+
!
2167+
! -------------------
21622168
!
21632169
! 49 = ASCAT_META_SM (ASCAT soil moisture ascending and descending orbits)
21642170
!

0 commit comments

Comments
 (0)