Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving empty and non-existent data table handling inside data_override #933

Merged
merged 6 commits into from
Mar 31, 2022
17 changes: 9 additions & 8 deletions data_override/data_override.F90
Original file line number Diff line number Diff line change
Expand Up @@ -365,20 +365,21 @@ subroutine read_table(data_table)
type(data_type) :: data_entry

logical :: ongrid
logical :: table_exists !< Flag indicating existence of data_table
character(len=128) :: region, region_type

integer :: sunit

! Read coupler_table
open(newunit=iunit, file='data_table', action='READ', iostat=io_status)
if(io_status/=0) then
if(io_status==29) then
call mpp_error(NOTE, 'data_override_mod: File data_table does not exist.')
else
call mpp_error(FATAL, 'data_override_mod: Error in opening file data_table.')
endif
endif
inquire(file='data_table', EXIST=table_exists)
thomas-robinson marked this conversation as resolved.
Show resolved Hide resolved
if (.not. table_exists) then
call mpp_error(NOTE, 'data_override_mod: File data_table does not exist.')
table_size = 0
return
end if

open(newunit=iunit, file='data_table', action='READ', iostat=io_status)
if(io_status/=0) call mpp_error(FATAL, 'data_override_mod: Error in opening file data_table.')
thomas-robinson marked this conversation as resolved.
Show resolved Hide resolved

ntable = 0
ntable_lima = 0
Expand Down