C Library Functions  - subse2 (3)

NAME

subse2(3f) - [M_datapac:VECTOR_OPERATION] extract the elements of a vector which fall into a user-specified subset (two subset variables)

CONTENTS

Synopsis
Description
Input Arguments
Output Arguments
Examples
Author
Maintainer
License

SYNOPSIS

SUBROUTINE SUBSE2(X,N,D1,D1min,D1max,D2,D2min,D2max,Y,Ny)

    REAL(kind=wp) :: D1(:), D1max, D1min, D2(:), D2max, D2min, X(:), Y(:)
    INTEGER       :: N, Ny

DESCRIPTION

This subroutine carries over into Y all observations of the precision precision vector X for which the corresponding elements in the precision precision vector D1 are inside the closed (inclusive) interval defined by D1MIN and D1MAX, and also for which the corresponding elements in the vector D2 are inside the closed (inclusive) interval defined by D2MIN and D2MAX.

No observations in X corresponding to elements of D1 or D2 outside of their respective intervals are carried over into Y.

The input vector X is itself unaltered; those elements of X to be retained are copied over into the output vector Y.

Thus all observations of X which correspond to elements in D1 which are smaller than D1MIN or larger than D1MAX, or which correspond to elements in D2 which are smaller than D2MIN or larger than D2MAX, are not copied over into Y.

The use of subse2(3f) gives the data analyst the capability to easily extract subsets of the data prior to data analysis on each subset.

INPUT ARGUMENTS

X the vector of (unsorted or sorted) observations.
N The integer number of observations in the vector x.
D1 A vector which (in conjunction with d2) "defines" the various possible subsets of x.
D1MIN The value which defines in d1 the lower limit (inclusively) of the particular subset of interest to be retained.
D1MAX The value which defines in d1 the upper limit (inclusively) of the particular subset of interest to be retained.
D2 A vector which (in conjunction with d2) "defines" the various possible subsets of x.
D2MIN The value which defines in d2 the lower limit (inclusively) of the particular subset of interest to be retained.
D2MAX The value which defines in d2 the upper limit (inclusively) of the particular subset of interest to be retained.

OUTPUT ARGUMENTS

Y The vector containing only those elements of X simultaneously corresponding to values of the D1 vector in the interval D1MIN to D1MAX (inclusive), and values of the D2 vector in the interval D2MIN to D2MAX (inclusive).
NY The integer number of retained observations copied into the vector Y.

EXAMPLES

Sample program:

   program demo_subse2
   use M_datapac, only : subse2
   implicit none
   ! call subse2(x,y)
   end program demo_subse2

Results:

AUTHOR

The original DATAPAC library was written by James Filliben of the Statistical Engineering Division, National Institute of Standards and Technology.

MAINTAINER

John Urban, 2022.05.31

LICENSE

CC0-1.0


Nemo Release 3.1 subse2 (3) July 22, 2023
Generated by manServer 1.08 from 04b5b56d-3971-4181-b79a-cfc31e5b9eb1 using man macros.