From 1c4c21e17156699f1cdcf87a6ccf8b269cc1b735 Mon Sep 17 00:00:00 2001 From: Helen Kershaw <20047007+hkershaw-brown@users.noreply.github.com> Date: Tue, 10 Mar 2026 16:24:05 -0400 Subject: [PATCH] fix: my_num_vars i8 for window calculation The window size is my_num_vars*copies_in_window*bytes which can be bigger than the i4 my_num_vars fixes #1051 --- assimilation_code/modules/utilities/win_mod.f90 | 4 ++-- assimilation_code/modules/utilities/winf08_mod.f90 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/assimilation_code/modules/utilities/win_mod.f90 b/assimilation_code/modules/utilities/win_mod.f90 index e96526100..2c424482b 100644 --- a/assimilation_code/modules/utilities/win_mod.f90 +++ b/assimilation_code/modules/utilities/win_mod.f90 @@ -57,7 +57,7 @@ subroutine create_state_window(state_ens_handle, fwd_op_ens_handle, qc_ens_handl integer :: ierr integer :: bytesize !< size in bytes of each element in the window -integer :: my_num_vars !< my number of vars +integer(i8) :: my_num_vars !< my number of vars ! Find out how many copies to get, maybe different to state_ens_handle%num_copies data_count = copies_in_window(state_ens_handle) @@ -97,7 +97,7 @@ subroutine create_mean_window(state_ens_handle, mean_copy, distribute_mean) integer :: ierr integer :: bytesize -integer :: my_num_vars !< number of elements a task owns +integer(i8) :: my_num_vars !< number of elements a task owns ! create an ensemble handle of just the mean copy. use_distributed_mean = distribute_mean diff --git a/assimilation_code/modules/utilities/winf08_mod.f90 b/assimilation_code/modules/utilities/winf08_mod.f90 index 54f14de3d..956462445 100644 --- a/assimilation_code/modules/utilities/winf08_mod.f90 +++ b/assimilation_code/modules/utilities/winf08_mod.f90 @@ -57,7 +57,7 @@ subroutine create_state_window(state_ens_handle, fwd_op_ens_handle, qc_ens_handl integer :: ierr integer :: bytesize !< size in bytes of each element in the window -integer :: my_num_vars !< my number of vars +integer(i8) :: my_num_vars !< my number of vars ! Find out how many copies to get, maybe different to state_ens_handle%num_copies data_count = copies_in_window(state_ens_handle) @@ -97,7 +97,7 @@ subroutine create_mean_window(state_ens_handle, mean_copy, distribute_mean) integer :: ierr integer :: bytesize -integer :: my_num_vars !< number of elements a task owns +integer(i8) :: my_num_vars !< number of elements a task owns ! create an ensemble handle of just the mean copy. use_distributed_mean = distribute_mean