Skip to content

Commit

Permalink
Merge pull request #290 from NCAR/bugfix-perfect_model_obs
Browse files Browse the repository at this point in the history
fix for perfect_model_obs memory corruption
  • Loading branch information
hkershaw-brown committed Sep 21, 2021
2 parents 62ecfa2 + 0795f11 commit af74fea
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 10 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ individual files.

The changes are now listed with the most recent at the top.

**September 21 2021 :: Bug fix for perfect_model_obs. Tag v9.11.10**

- perfect_model_obs now exits cleanly when no filenames are given
for the input_state_files or output_state_files namelist options.

**August 30 2021 :: Repository clean-up and DART registration form. Tag: v9.11.9**

*removed obsolete code:*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,15 @@ subroutine perfect_main()
call parse_filenames(input_state_files, input_filelist, nfilesin)
call parse_filenames(output_state_files, output_filelist, nfilesout)

!> @todo FIXME if nfilesout == 0 and write_output_state_to_file is .false.
!> that shouldn't be an error. if nfilesin == 0 and read_input_state_from_file
!> is false, that also shouldn't be an error. (unless you're writing the mean
!> and sd, and then maybe we should have a different name for output of input values.)
if (nfilesin == 0 .or. nfilesout == 0 ) then
msgstring = 'must specify both "input_state_files" and "output_state_files" in the namelist'
call error_handler(E_ERR,'perfect_main',msgstring,source)
endif

allocate(true_state_filelist(nfilesout))

! mutiple domains ( this is very unlikely to be the case, but in order to
Expand All @@ -275,15 +284,6 @@ subroutine perfect_main()
true_state_filelist(1) = 'true_state.nc'
endif

!> @todo FIXME if nfilesout == 0 and write_output_state_to_file is .false.
!> that shouldn't be an error. if nfilesin == 0 and read_input_state_from_file
!> is false, that also shouldn't be an error. (unless you're writing the mean
!> and sd, and then maybe we should have a different name for output of input values.)
if (nfilesin == 0 .or. nfilesout == 0 ) then
msgstring = 'must specify both "input_state_files" and "output_state_files" in the namelist'
call error_handler(E_ERR,'perfect_main',msgstring,source)
endif

call io_filenames_init(file_info_input, 1, cycling=has_cycling, single_file=single_file_in)
call set_file_metadata(file_info_input, 1, input_filelist, 'perfect_input', 'pmo initial condition')
call set_io_copy_flag( file_info_input, 1, READ_COPY)
Expand Down
2 changes: 1 addition & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
author = 'Data Assimilation Research Section'

# The full version, including alpha/beta/rc tags
release = '9.11.9'
release = '9.11.10'
master_doc = 'README'

# -- General configuration ---------------------------------------------------
Expand Down

0 comments on commit af74fea

Please sign in to comment.