anchor.diff:                      periods_emax(period + 1, :num_states) = predictions
   
                       ! The leading slave updates the master period by period.
  -                    IF (rank == 0) THEN
  -                        CALL MPI_SEND(periods_emax(period + 1, :num_states), num_states, MPI_DOUBLE, 0, period, PARENTCOMM, ierr)    
  -
  -                    END IF
  +                    IF (rank == 0) CALL MPI_SEND(periods_emax(period + 1, :num_states), num_states, MPI_DOUBLE, 0, period, PARENTCOMM, ierr)    
  +
                       ! Deallocate containers
                       DEALLOCATE(is_simulated); DEALLOCATE(exogenous); DEALLOCATE(maxe);
                       DEALLOCATE(endogenous); DEALLOCATE(predictions)
   
  -
                    ELSE
   
                       count =  1
  
positive.code: 
                      ! Constructing indicator for simulation points
                      is_simulated = get_simulated_indicator(num_points_interp, num_states, period)
  
         
                      ! Constructing the dependent variable for all states, including the ones where simulation will take place. All information will be used in either the construction of the prediction model or the prediction step.
                      CALL get_exogenous_variables(exogenous, maxe, period, num_states, periods_payoffs_systematic, shifts, mapping_state_idx, periods_emax, states_all)
  
  
  
                      ! Initialize missing values
                      endogenous = MISSING_FLOAT
  
negative.code:                     CALL distribute_information(num_emax_slaves, period, periods_emax_slaves, periods_emax(period + 1, :))
                      
                      ! The leading slave updates the master period by period.
                      IF (rank == 0) CALL MPI_SEND(periods_emax(period + 1, :num_states), num_states, MPI_DOUBLE, 0, period, PARENTCOMM, ierr)            
            
                  END IF
  
                  DEALLOCATE(periods_emax_slaves); DEALLOCATE(endogenous_slaves)
      
              END DO
          
  