subroutine register_data (u, data_type, plane, d2data, d1data, data, n1, n2, n_last) use cesrv_struct use cesrv_interface implicit none type (universe_struct), target :: u type (d2_data_struct), target :: d2data type (d1_data_struct), target :: d1data type (data_struct) :: data(:) integer :: n, n1, n2, n_last, data_type, plane, n_next, n_off ! d2data%veto_above_100 = .false. n_next = n_last + n2 - n1 + 1 call data_ptr_set (d1data%d, data(n_last+1:n_next), n1) d1data%d2 => d2data data(n_last+1:n_next)%name = d1data%name n_off = n_last + 1 - n1 do n = n1, n2 data(n+n_off)%d1 => d1data data(n+n_off)%ix_index = n enddo d2data%type = data_type d1data%plane = plane d2data%ew_encode = .true. d2data%u => u if (plane == x_plane$ .or. plane == y_plane$ .or. plane == z_plane$) then nullify(d2data%m11%d) nullify(d2data%m12%d) nullify(d2data%m21%d) nullify(d2data%m22%d) nullify(d2data%d1%d) elseif (plane == null_plane$) then nullify(d2data%m11%d) nullify(d2data%m12%d) nullify(d2data%m21%d) nullify(d2data%m22%d) nullify(d2data%x%d) nullify(d2data%y%d) else nullify(d2data%x%d) nullify(d2data%y%d) nullify(d2data%d1%d) endif d1data%ix_data = n_off n_last = n_next if (n_last > n_data_maxx) then print *, 'ERROR: DATA ARRAY OVERFLOW!', n_last, n_data_maxx call err_exit endif d2data%measured = .false. d2data%ref_measured = .false. d2data%ix_meas = 0 d2data%ix_ref = 0 end subroutine