Skip to content

Commit

Permalink
Fix logic when checking if multiple tables exist
Browse files Browse the repository at this point in the history
  • Loading branch information
uramirez8707 committed Sep 4, 2024
1 parent 1698bbe commit 0e8c359
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion data_override/include/data_override.inc
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ subroutine read_table_yaml(data_table)
! If doing and ensemble or nest run add the filename appendix (ens_XX or nest_XX) to the filename
call get_instance_filename("data_table.yaml", filename)
if (trim(filename) .ne. "data_table.yaml") then
if (index(trim(filename), "ens_") .ne. 0) then
if (file_exists(filename) .and. file_exists("data_table.yaml")) &
call mpp_error(FATAL, "Both data_table.yaml and "//trim(filename)//" exists, pick one!")
endif
Expand Down
2 changes: 1 addition & 1 deletion diag_manager/fms_diag_yaml.F90
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ subroutine diag_yaml_object_init(diag_subset_output)

! If doing and ensemble or nest run add the filename appendix (ens_XX or nest_XX) to the filename
call get_instance_filename("diag_table.yaml", yamlfilename)
if (trim(yamlfilename) .ne. "diag_table.yaml") then
if (index(trim(yamlfilename), "ens_") .ne. 0) then
if (file_exists(yamlfilename) .and. file_exists("diag_table.yaml")) &
call mpp_error(FATAL, "Both diag_table.yaml and "//trim(yamlfilename)//" exists, pick one!")
endif
Expand Down
2 changes: 1 addition & 1 deletion field_manager/field_manager.F90
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ subroutine read_field_table_yaml(nfields, table_name)
endif

call get_instance_filename(tbl_name, filename)
if (trim(filename) .ne. tbl_name) then
if (index(trim(filename), "ens_") .ne. 0) then
if (file_exists(filename) .and. file_exists(tbl_name)) &
call mpp_error(FATAL, "Both "//trim(tbl_name)//" and "//trim(filename)//" exists, pick one!")
endif
Expand Down
3 changes: 0 additions & 3 deletions fms2_io/fms_io_utils.F90
Original file line number Diff line number Diff line change
Expand Up @@ -811,9 +811,6 @@ subroutine get_instance_filename(name_in,name_out)
length = len_trim(name_in)
name_out = name_in(1:length)

!< If the filename_appendix is not set just return
if (trim(filename_appendix) .eq. "") return

if(len_trim(filename_appendix) > 0) then
!< If .tileXX is in the filename add the appendix before it
if (has_domain_tile_string(name_in)) then
Expand Down

0 comments on commit 0e8c359

Please sign in to comment.