[Dart-dev] DART/branches Revision: 11633
dart at ucar.edu
dart at ucar.edu
Fri May 12 16:56:10 MDT 2017
hendric at ucar.edu
2017-05-12 16:56:09 -0600 (Fri, 12 May 2017)
191
renaming limit_mem to buffer_state_io. buffer_state_io
is now a logical that states if a variable that tells
DART it it should read and write variables all at once
or variable by variable.
Modified: DART/branches/rma_trunk/assimilation_code/modules/io/direct_netcdf_mod.f90
===================================================================
--- DART/branches/rma_trunk/assimilation_code/modules/io/direct_netcdf_mod.f90 2017-05-12 17:55:38 UTC (rev 11632)
+++ DART/branches/rma_trunk/assimilation_code/modules/io/direct_netcdf_mod.f90 2017-05-12 22:56:09 UTC (rev 11633)
@@ -25,7 +25,7 @@
!> \par Aim of the limited transpose:
!>
!>To limit how much of the state vector you can read at once.
-!> You can limit the transpose by memory using <code>limit_mem</code>.
+!> You can limit the transpose by memory using <code>buffer_state_io</code>.
!>
!>What you (potentially) gain from this:
!>
@@ -32,7 +32,7 @@
!>* Don't have to have the whole state vector.
!>* Don't have to use a parallel IO library.
!>
-!>If limit_mem > state vector size you have the regular transpose + IO, except:
+!>If buffer_state_io is false you have the regular transpose + IO, except:
!> 1. You are reading directly from a netcdf file, not a dart state vector file.
!> 2. You only transpose the copies that are being written/read.
!>
@@ -133,18 +133,18 @@
!> * Multi processor (memory limit applied)
-subroutine read_transpose(state_ens_handle, name_handle, domain, dart_index, limit_mem)
+subroutine read_transpose(state_ens_handle, name_handle, domain, dart_index, read_single_vars)
type(ensemble_type), intent(inout) :: state_ens_handle
type(stage_metadata_type), intent(in) :: name_handle
integer, intent(in) :: domain
integer, intent(inout) :: dart_index !< This is for multiple domains
-integer, intent(in) :: limit_mem !< How many state elements you can read at once
+logical, intent(in) :: read_single_vars !< read one variable at a time
if (task_count() == 1) then
call read_transpose_single_task(state_ens_handle, name_handle, domain, dart_index)
else
- call read_transpose_multi_task(state_ens_handle, name_handle, domain, dart_index, limit_mem)
+ call read_transpose_multi_task(state_ens_handle, name_handle, domain, dart_index, read_single_vars)
endif
end subroutine read_transpose
@@ -155,13 +155,13 @@
subroutine transpose_write(state_ens_handle, name_handle, domain, &
- dart_index, limit_mem, write_single_precision)
+ dart_index, write_single_vars, write_single_precision)
type(ensemble_type), intent(inout) :: state_ens_handle
type(stage_metadata_type), intent(in) :: name_handle
integer, intent(in) :: domain
integer, intent(inout) :: dart_index
-integer, intent(in) :: limit_mem !< How many state elements you can write at once
+logical, intent(in) :: write_single_vars !< write one variable at a time
logical, intent(in) :: write_single_precision
if (task_count() == 1) then
@@ -169,7 +169,7 @@
dart_index, write_single_precision)
else
call transpose_write_multi_task(state_ens_handle, name_handle, domain, &
- dart_index, limit_mem, write_single_precision)
+ dart_index, write_single_vars, write_single_precision)
endif
end subroutine transpose_write
@@ -348,16 +348,16 @@
!> Read in variables from model restart file and transpose so that every processor
!> has all copies of a subset of state variables (fill state_ens_handle%copies)
!> Read and transpose data according to the memory limit imposed by
-!> limit_mem. Note limit_mem cannot be smaller than a variable.
+!> read_var_by_var.
subroutine read_transpose_multi_task(state_ens_handle, name_handle, domain, &
- dart_index, limit_mem)
+ dart_index, read_var_by_var)
type(ensemble_type), intent(inout) :: state_ens_handle
type(stage_metadata_type), intent(in) :: name_handle
integer, intent(in) :: domain
integer, intent(inout) :: dart_index !< This is for multiple domains
-integer, intent(in) :: limit_mem !< How many state elements you can read at once
+logical, intent(in) :: read_var_by_var !< Read one variable at a time
integer :: i
integer :: start_var, end_var !< start/end variables in a read block
@@ -426,7 +426,12 @@
if (start_var > num_state_variables) exit ! instead of using do while loop
! calculate how many variables will be read
- end_var = calc_end_var(start_var, domain, limit_mem)
+ if (read_var_by_var) then
+ end_var = start_var
+ else
+ end_var = num_state_variables
+ endif
+
block_size = get_sum_variables(start_var, end_var, domain)
More information about the Dart-dev
mailing list