Skip to content

Commit

Permalink
Eliminated compiler dependent check for data_table existence.
Browse files Browse the repository at this point in the history
  • Loading branch information
GFDL-Eric committed Mar 29, 2022
1 parent 04d57de commit 275d73e
Showing 1 changed file with 9 additions and 8 deletions.
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)
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.')

ntable = 0
ntable_lima = 0
Expand Down

0 comments on commit 275d73e

Please sign in to comment.