Skip to content

Commit 185f057

Browse files
committed
re-instated "Nx+-" functionality for optional segment in MET_TAG to ensure backward compatibility with LDAS regression tests (to be cleaned up later) (LDAS_Forcing.F90)
1 parent 88da354 commit 185f057

File tree

1 file changed

+30
-4
lines changed

1 file changed

+30
-4
lines changed

GEOSmetforce_GridComp/LDAS_Forcing.F90

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3798,6 +3798,19 @@ subroutine get_GEOS( date_time, force_dtstep, met_path, met_tag, &
37983798
GEOSgcm_defs(1:N_G5DAS_vars,:) = GEOSIT_defs
37993799
else if ( use_bkg ) then
38003800
GEOSgcm_defs(1:N_G5DAS_vars,:) = G5BKG_defs
3801+
3802+
! +++++++++++++++++++++++++++++
3803+
! for now, keep 'Nx+-' to ensure backward compatibility w/ regression tests; 'Nx+-' is obsolete otherwise
3804+
! - reichle, 14 Apr 2025
3805+
if (index(met_tag, 'Nx+-') > 0) then ! "met_tag" here is as specified in LDAS.rc, incl. optional tag segments
3806+
GEOSgcm_defs(1:N_G5DAS_vars,:) = G5DAS_defs
3807+
! append "+-" to GCM file tag (ie, replace "Nx" with "Nx+-")
3808+
do j=1,N_GEOSgcm_vars
3809+
GEOSgcm_defs(j,3) = trim(GEOSgcm_defs(j,3)) // '+-'
3810+
end do
3811+
end if
3812+
! +++++++++++++++++++++++++++++
3813+
38013814
else
38023815
GEOSgcm_defs(1:N_G5DAS_vars,:) = G5DAS_defs
38033816
end if
@@ -5435,8 +5448,12 @@ subroutine parse_G5DAS_met_tag( met_path_in, met_tag_in, date_time, &
54355448

54365449
prec_tag = tmp_tag(ii)(5:len(tmp_tag(ii)))
54375450

5438-
elseif (tmp_tag(ii)(1:3)=='bkg') then
5439-
5451+
elseif ( (tmp_tag(ii)(1:3)=='bkg') .or. (tmp_tag(ii)(1:4)=='Nx+-') ) then
5452+
! ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5453+
! for now, keep 'Nx+-' to ensure backward compatibility w/ regression tests; 'Nx+-' is obsolete otherwise
5454+
! - reichle, 14 Apr 2025
5455+
! +++++++++++++++++++++++++++++
5456+
54405457
use_bkg = .true.
54415458

54425459
else
@@ -5467,7 +5484,7 @@ subroutine parse_G5DAS_met_tag( met_path_in, met_tag_in, date_time, &
54675484
! Double-check if optional tag segments were somehow missed, e.g.,
54685485
! because they were accidentally appended with single underscores.
54695486
! Assumes that "prec" and "Nx+-" never appear in GEOS-5 product names.
5470-
! Does NOT protect against spelling errors, e.g., "__perc" or "__Nx-+".
5487+
! Does NOT protect against spelling errors, e.g., "__perc" or "__bgk" or "__Nx-+".
54715488
! - reichle, 24 Nov 2015
54725489

54735490
if ((.not. use_prec_corr) .and. (index( met_tag_in, 'prec')>0)) then
@@ -5483,7 +5500,16 @@ subroutine parse_G5DAS_met_tag( met_path_in, met_tag_in, date_time, &
54835500
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
54845501

54855502
end if
5486-
5503+
5504+
! +++++++++++++++++++++++++++++
5505+
! for now, keep 'Nx+-' to ensure backward compatibility w/ regression tests; 'Nx+-' is obsolete otherwise
5506+
! - reichle, 14 Apr 2025
5507+
if ((.not. use_bkg) .and. (index( met_tag_in, 'Nx+-')>0)) then
5508+
err_msg = 'questionable met_tag_in: includes "Nx+-" but use_bkg=.false.'
5509+
call ldas_abort(LDAS_GENERIC_ERROR, Iam, err_msg)
5510+
end if
5511+
! +++++++++++++++++++++++++++++
5512+
54875513
end subroutine parse_G5DAS_met_tag
54885514

54895515
! ****************************************************************

0 commit comments

Comments
 (0)