Skip to content

Commit

Permalink
fix to enable no history configurations in nl
Browse files Browse the repository at this point in the history
  • Loading branch information
Courtney Peverley committed Aug 7, 2024
1 parent 8ac3838 commit 48f0807
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/history/cam_hist_file.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2096,16 +2096,16 @@ subroutine hist_read_namelist_config(filename, config_arr)
!
! Cleanup
!
! Special block for testing
call MPI_bcast(read_status, 1, MPI_INTEGER, masterprocid, mpicom, ierr)
if (read_status /= 0) then
return
end if
! Close unitn if it is still open
inquire(unit=unitn, opened=filefound, iostat=ierr)
if ((ierr == 0) .and. filefound) then
close(unitn)
end if
! Special block for testing
call MPI_bcast(read_status, 1, MPI_INTEGER, masterprocid, mpicom, ierr)
if (read_status /= 0) then
return
end if
if (allocated(hist_inst_fields)) then
deallocate(hist_inst_fields)
end if
Expand Down
6 changes: 4 additions & 2 deletions src/history/cam_history.F90
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@ subroutine history_add_field_nd(diagnostic_name, standard_name, dimnames, avgfla
character(len=3) :: mixing_ratio_loc
character(len=*), parameter :: subname = 'history_add_field_nd: '

if (size(hist_configs) > 0 .and. hist_configs(1)%file_is_setup()) then
call endrun ('history_add_field_nd: Attempt to add field '//trim(diagnostic_name)//' after history files set')
if (size(hist_configs) > 0) then
if (hist_configs(1)%file_is_setup()) then
call endrun ('history_add_field_nd: Attempt to add field '//trim(diagnostic_name)//' after history files set')
end if
end if

! Some checks for diagnostic_name
Expand Down

0 comments on commit 48f0807

Please sign in to comment.