Skip to content

Commit

Permalink
Merge pull request #418 from NCAR/bug-fix_perf-mod
Browse files Browse the repository at this point in the history
move window creation and destruction for perfect_model_obs
  • Loading branch information
hkershaw-brown authored Nov 3, 2022
2 parents bb4dae2 + cc4c407 commit 276f72a
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 26 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ individual files.

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

**November 3 2022 :: Bug-fix release. Tag v10.5.4**

- Perfect_model_obs (pmo) fixed for running with MPI and advancing the
model inside pmo.
- MPAS_ATM xtime string padded with blanks for easier bitwise comparison.
- lorenz_96_tracer_advection quickbuild.sh fixed.

**October 13 2022 :: Bug-fix for read variables. Tag v10.5.3**

- Per-file check for unlimited dimension before variable read. Netcdf
Expand Down
20 changes: 7 additions & 13 deletions assimilation_code/programs/perfect_model_obs/perfect_model_obs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ program perfect_model_obs
logical :: trace_execution = .false.
logical :: output_timestamps = .false.
logical :: silence = .false.
logical :: distributed_state = .true.

! if init_time_days and seconds are negative initial time is 0, 0
! for no restart or comes from restart if restart exists
Expand Down Expand Up @@ -118,7 +117,7 @@ program perfect_model_obs
trace_execution, output_timestamps, &
print_every_nth_obs, output_forward_op_errors, &
input_state_files, output_state_files, &
single_file_in, single_file_out, distributed_state
single_file_in, single_file_out

!------------------------------------------------------------------------------

Expand Down Expand Up @@ -244,11 +243,7 @@ subroutine perfect_main()

! Set up the ensemble storage and read in the restart file
call trace_message('Before reading in ensemble restart file')
if(distributed_state) then
call init_ensemble_manager(ens_handle, ens_size, model_size)
else
call init_ensemble_manager(ens_handle, ens_size, model_size, transpose_type_in = 2)
endif
call init_ensemble_manager(ens_handle, ens_size, model_size)

call set_num_extra_copies(ens_handle, 0)

Expand Down Expand Up @@ -325,9 +320,6 @@ subroutine perfect_main()

call trace_message('After reading in ensemble restart file')

! Create window for forward operators
call create_state_window(ens_handle)

!>@todo FIXME this block must be supported in the single file loop with time dimension
call trace_message('Before initializing output diagnostic file')
state_meta(1) = 'true state'
Expand Down Expand Up @@ -480,6 +472,9 @@ subroutine perfect_main()
write(msgstring, '(A,I8,A)') 'Ready to evaluate up to', size(keys), ' observations'
call trace_message(msgstring, 'perfect_model_obs:', -1)

! Set up access to the state
call create_state_window(ens_handle)

! Compute the forward observation operator for each observation in set
do j = 1, fwd_op_ens_handle%my_num_vars

Expand Down Expand Up @@ -575,6 +570,8 @@ subroutine perfect_main()

endif

! End access to the state
call free_state_window(ens_handle)

! Deallocate the keys storage
deallocate(keys)
Expand Down Expand Up @@ -613,9 +610,6 @@ subroutine perfect_main()
call trace_message('After writing state restart file if requested')
call trace_message('Before ensemble and obs memory cleanup')

! Close the windows
call free_state_window(ens_handle)

! Release storage for ensemble
call end_ensemble_manager(ens_handle)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
output_state_files = "",
output_interval = 1,

distributed_state = .false.,
async = 0,
adv_ens_command = "./advance_model.csh",
tasks_per_model_advance = 1,
Expand Down
10 changes: 0 additions & 10 deletions assimilation_code/programs/perfect_model_obs/perfect_model_obs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ namelist.
write_output_state_to_file = .false.,
output_interval = 1,

distributed_state = .false.,
async = 0,
adv_ens_command = "./advance_model.csh",
tasks_per_model_advance = 1,
Expand Down Expand Up @@ -87,15 +86,6 @@ namelist.
| | | diagnostics every nth assimilation |
| | | time, n is output_interval. |
+---------------------------------------+---------------------------------------+---------------------------------------+
| distributed_state | logical | True means the ensemble data is |
| | | distributed across all tasks as it is |
| | | read in, so a single task never has |
| | | to have enough memory to store the |
| | | data for an ensemble member. Large |
| | | models should always set this to |
| | | .true., while for small models it may |
| | | be faster to set this to .false. |
+---------------------------------------+---------------------------------------+---------------------------------------+
| async | integer | Controls method for advancing model: |
| | | |
| | | - 0 = subroutine call |
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 = '10.5.3'
release = '10.5.4'
master_doc = 'README'

# -- General configuration ---------------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion models/POP/work/input.nml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
print_every_nth_obs = -1
output_forward_op_errors = .false.
silence = .false.
distributed_state = .true.
/

&filter_nml
Expand Down

0 comments on commit 276f72a

Please sign in to comment.