pxfstructcopy

Date:

10-20-2011

NAME

PXFSTRUCTCOPY - Copies structure

SYNOPSIS

INTEGER jhandle1, jhandle2, ierror
CHARACTER*n structname
CALL PXFSTRUCTCOPY(structname, jhandle1, jhandle2, ierror)

IMPLEMENTATION

Cray Linux Environment (CLE)

STANDARDS

IEEE Std 1003.9-1992 standard interface for FORTRAN 77

DESCRIPTION

The PXFSTRUCTCOPY routine copies structures created with PXFSTRUCTCREATE(3F). The structure referenced by jhandle1 is copied to the structure referenced by jhandle2.

All arguments must be of default kind unless documented otherwise. Default kind is KIND=4 for integer, real, complex, and logical arguments.

The following are valid arguments for this routine:

structname

An input character variable or array element containing the structure name corresponding to the two structure handles’ type.

jhandle1

An input structure handle variable to be copied.

jhandle2

An output structure handle variable that will contain a copy of the structure of jhandle1 after successful execution of PXFSTRUCTCOPY.

ierror

An output integer variable that contains zero if PXFSTRUCTCOPY was successful or nonzero if PXFSTRUCTCOPY was not successful.

EXAMPLES

In this example, two utsname structures are created using PXFSTRUCTCREATE(3F). PXFUNAME(3F) is called with one utsname structure, which is then copied to the other utsname structure.

program pxftest
integer jhandle1, jhandle2
integer ierror

CALL PXFSTRUCTCREATE('utsname',jhandle1,ierror)
if (ierror .ne. 0) then
   print *,' FAILED: PXFSTRUCTCREATE for utsname1'
else
   CALL PXFSTRUCTCREATE('utsname',jhandle2,ierror)
   if (ierror .ne. 0) then
      print *,' FAILED: PXFSTRUCTCREATE for utsname2 with error = ',ierror
   else
      CALL PXFUNAME(jhandle1,ierror)
      if (ierror .ne. 0) then
         print *,' FAILED: PXFUNAME for utsname1 with error = ',ierror
      else
         CALL PXFSTRUCTCOPY('utsname',jhandle1,jhandle2,ierror)
         if (ierror .ne. 0) then
            print *,' FAILED: PXFSTRUCTCOPY with error = ', ierror
         else
            print *,' PASSED: PXFSTRUCTCOPY test for utsname struct'
         endif
      endif
   endif
endif
CALL PXFSTRUCTFREE(jhandle1,ierror)
CALL PXFSTRUCTFREE(jhandle2,ierror)
end

SEE ALSO

PXFSTRUCTCREATE(3F), PXFUNAME(3F)