NCAR / DART

Data Assimilation Research Testbed
https://dart.ucar.edu/
Apache License 2.0
195 stars 145 forks source link

Bug?: direct_netcdf_mod.f90 assumes round robin distribution for ensemble #283

Open hkershaw-brown opened 3 years ago

hkershaw-brown commented 3 years ago

direct_netcdf_io.f90:

2933 !=================================================
2934 ! Routines for distributing data round-robbin
2935 !=================================================

!> This code has multiple places where round-robin layout of state onto task is assumed.
!> These are in the section labelled:
!>    ! Routines that are making the assumption that the ensemble
!>    ! distribution is round-robin (distribution type 1)  

Note distribution type 1 is not round robin, it is simple layout. So if you set your ensemble_manager_nml::layout=1 (simple) I think you may get incorrect info read in/written out. edit: Nope, see note below on layout vs. distribution

I'm missing why perfect_model_obs has layout 1 (simple) for fwd op and qc, but these handles are not involved in the netcdf state read/write https://github.com/NCAR/DART/blob/62ecfa2a2b4c7de55f98f434de49e076060fd82c/assimilation_code/programs/perfect_model_obs/perfect_model_obs.f90#L454

will confirm with test case for state IO

Affects filter, perfect_model_obs.

hkershaw-brown commented 3 years ago

note on distribution vs layout.

ensemble_manager_mod.f90 uses layout for round-robin vs simple. this is for logical pe to physical task.

direct_netcdf_mod.f90 uses distribution for round-robin. distribution_type is an option to init_ensemble_manager but is not used. This is which pe gets which elements of the state.

So, not a bug at the moment, but will cause problems if the state is not round robin on pes. (add to refactor list)