release_layers_3D_C_reduction Subroutine

public subroutine release_layers_3D_C_reduction(release_buffers)

Release communicators for 3D layers for C-reduction

Arguments

Type IntentOptional Attributes Name
logical, optional :: release_buffers

Source Code

   SUBROUTINE release_layers_3D_C_reduction(release_buffers)
      !! Release communicators for 3D layers for C-reduction
      LOGICAL, OPTIONAL                                  :: release_buffers

      INTEGER                                            :: ibuff

      layers_3D_C_reduction%grp = mp_comm_null
      IF (layers_3D_C_reduction%rowgrp3D .NE. mp_comm_null) CALL mp_comm_free(layers_3D_C_reduction%rowgrp3D)
      IF (layers_3D_C_reduction%grp3D .NE. mp_comm_null) CALL mp_comm_free(layers_3D_C_reduction%grp3D)
      layers_3D_C_reduction%rowgrp3D = mp_comm_null
      layers_3D_C_reduction%grp3D = mp_comm_null
      layers_3D_C_reduction%num_layers_3D = 1
      layers_3D_C_reduction%side3D = HUGE(1)

      IF (PRESENT(release_buffers)) THEN
         IF (release_buffers .AND. ALLOCATED(layers_3D_C_reduction%data_red3D)) THEN
            DO ibuff = 1, SIZE(layers_3D_C_reduction%data_red3D)
               CALL dbcsr_data_release(layers_3D_C_reduction%data_red3D(ibuff))
            END DO
            DEALLOCATE (layers_3D_C_reduction%data_red3D)
         END IF
      END IF
   END SUBROUTINE release_layers_3D_C_reduction