!   TITLE:  mat_transfer.mac (MANAGEMENT)
!
!
!   OBJECTIVE:
!
!   This macro transfers material property data from one material to another
!   material of a different name.
!
!
!   COMMAND SYNTAX:
!
!                             (1)          (2)       (3)
!           MAT_TRANSFER, 'source_mat', 'targ_mat', T_ref
!
!
!   ARGUMENTS:
!
!           (1) source_mat = source material name to be transfered FROM.
!
!           (2) targ_mat = target material name to be transfered TO.
!
!           (3) T_ref = reference temperature for the source material data.
!                       [ Default value of 0 ]
!
!
!   DESCRIPTION:
!
!   This macro allows for the creation of a user-defined generic material.
!
!   If the source material is not currently initialized in the data base, it
!   will be initialized and its property data transferred to the target.
!
!   If the new (target) material does not exist, it will be created and the
!   material data from the source will be stored in the new material name.
!
!   If the target material already exists, then the material data from the
!   source will over-write the current material properties in the target
!   name.
!
!
!
*get,prkey_,active,0,prkey
/nopr
!
srcmat_=arg1
targmat_=arg2
tref_=arg3
!
mat_select,srcmat_
!
nprop_=42
!
*do,abcd_,1,nprop_,1
    *get,mdat_%abcd_%,prop_lab(abcd_,1),%srcmat_%,temp,tref_
*enddo
!
*do,abcd_,1,nprop_,1
    create_mat_prop,targmat_,prop_lab(abcd_,1),mdat_%abcd_%
*enddo
!
*do,abcd_,1,nprop_,1
    *set,mdat_%abcd_%,
*enddo
!
*set,abcd_,
*set,srcmat_,
*set,targmat_,
*set,tref_,
*set,nprop_,
!
*if,prkey_,eq,1,then
    /go
*endif