@@ -19,7 +19,7 @@ module MOM_open_boundary
19
19
use MOM_interface_heights, only : thickness_to_dz
20
20
use MOM_interpolate, only : init_external_field, time_interp_external, time_interp_external_init
21
21
use MOM_interpolate, only : external_field
22
- use MOM_io, only : slasher, field_size, SINGLE_FILE
22
+ use MOM_io, only : slasher, field_size, file_exists, SINGLE_FILE
23
23
use MOM_io, only : vardesc, query_vardesc, var_desc
24
24
use MOM_obsolete_params, only : obsolete_logical, obsolete_int, obsolete_real, obsolete_char
25
25
use MOM_regridding, only : regridding_CS
@@ -913,12 +913,13 @@ subroutine initialize_segment_data(G, GV, US, OBC, PF)
913
913
fieldname = trim (fieldname)// trim (suffix)
914
914
call field_size(filename,fieldname,siz,no_domain= .true. )
915
915
! if (siz(4) == 1) segment%values_needed = .false.
916
+ if (.not. file_exists(filename)) &
917
+ call MOM_error(FATAL," Unable to open OBC file " // trim (filename))
916
918
if (segment% on_pe) then
917
919
if (OBC% brushcutter_mode .and. (modulo (siz(1 ),2 ) == 0 .or. modulo (siz(2 ),2 ) == 0 )) then
918
920
write (mesg,' ("Brushcutter mode sizes ", I6, I6)' ) siz(1 ), siz(2 )
919
921
call MOM_error(WARNING, mesg // " " // trim (filename) // " " // trim (fieldname))
920
- call MOM_error(FATAL,' segment data are not on the supergrid. Your OBC file name may ' // &
921
- ' not match the name in MOM_input or be missing.' )
922
+ call MOM_error(FATAL,' segment data are not on the supergrid.' )
922
923
endif
923
924
siz2(1 ) = 1
924
925
0 commit comments