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

(*)close_param_file always closes the input files #549

Merged
merged 2 commits into from
Jul 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/framework/MOM_file_parser.F90
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ subroutine close_param_file(CS, quiet_close, component)

if (present(quiet_close)) then ; if (quiet_close) then
do i = 1, CS%nfiles
if (all_PEs_read .or. is_root_pe()) close(CS%iounit(i))
call MOM_mesg("close_param_file: "// trim(CS%filename(i))// &
" has been closed successfully.", 5)
CS%iounit(i) = -1
CS%filename(i) = ''
CS%NetCDF_file(i) = .false.
Expand Down Expand Up @@ -322,14 +325,9 @@ subroutine close_param_file(CS, quiet_close, component)

num_unused = 0
do i = 1, CS%nfiles
! only root pe has the file open
if (all_PEs_read .or. is_root_pe()) close(CS%iounit(i))
call MOM_mesg("close_param_file: "// trim(CS%filename(i))// &
" has been closed successfully.", 5)

! Check for unused lines.
if (is_root_pe() .and. (CS%report_unused .or. &
CS%unused_params_fatal)) then
! Check for unused lines.
do n=1,CS%param_data(i)%num_lines
if (.not.CS%param_data(i)%line_used(n)) then
num_unused = num_unused + 1
Expand All @@ -340,6 +338,9 @@ subroutine close_param_file(CS, quiet_close, component)
enddo
endif

if (all_PEs_read .or. is_root_pe()) close(CS%iounit(i))
call MOM_mesg("close_param_file: "// trim(CS%filename(i))// &
" has been closed successfully.", 5)
CS%iounit(i) = -1
CS%filename(i) = ''
CS%NetCDF_file(i) = .false.
Expand Down