!----------------------------------------------------------------------- integer function my_msrcp(opts,src,dest) implicit none ! ! Build and execute msrcp command to the shell. Assume "mss:" prefixes ! either src (for a get) or dest (for a put). ! ! Args: character(len=*),intent(in) :: opts,src,dest ! ! Local: character(len=1024) :: cmd integer :: ier ! ! External: integer,external :: isystem ! if (src(1:4) /= "mss:" .and. dest(1:4) /= "mss:") then write(6,"(/,'>>> my_msrcp: need mss: prefix on either src or ', | 'dest')") write(6,"('src=',a)") trim(src) write(6,"('dest=',a)") trim(dest) call shutdown('my_msrcp') endif ! ! Only master task does the msrcp: if (src(1:4) == "mss:") then write(6,"('my_msrcp: Obtaining file ',a,' from mss.')") | src(5:len_trim(src)) else write(6,"('my_msrcp: Disposing file ',a,' to mss.')") | dest(5:len_trim(dest)) endif cmd = ' ' cmd = "msrcp "//trim(opts)//' '//trim(src)//' '//trim(dest) write(6,"(a)") trim(cmd) my_msrcp = isystem(cmd) end function my_msrcp !----------------------------------------------------------------------- integer function isystem(command) implicit none ! ! Execute command to the shell. UNICOS and IRIX use ishell(), ! AIX uses system(). ! character(len=*),intent(in) :: command #if defined(UNICOS) || defined(IRIX) integer,external :: ishell isystem = ishell(trim(command)) #elif defined (AIX) integer,external :: system isystem = system(trim(command)//"\0") #elif defined(OSF1) integer,external :: system isystem = system(trim(command)) #elif defined(SUN) integer,external :: system isystem = system(trim(command)) #elif defined(LINUX) integer,external :: system isystem = system(trim(command)) #endif end function isystem !-------------------------------------------------------------------