!+STCL
subroutine stcal

    implicit none

    !-----------------------------------------------------------------------
    ! Description: Moves a user specified list of files into the Caldb
    !              based on their storage location as read from the
    !              caldbconfig file.
    !
    ! Arguments:   NONE
    !
    ! Origin:      Written for the Calibration Database
    !
    ! Authors/Modification History:
    ! Ron Zellar Sep 15 1994 -- Original Version
    ! MFC Apr 16 2020 -- f90 version
    !-----------------------------------------------------------------------
    !-

    character(160) files
    integer errstat
    logical verbose

    character(40) taskname
    common /task/ taskname
    taskname = 'stcal'

    errstat = 0

    !	Get parameter values from the par file
    call gpstcl(files, verbose, errstat)

    if (errstat.ne.0) return

    !	Store the calibration files
    call strcal(files, verbose, errstat)

    return
end

!+GPSTCL
subroutine gpstcl(files, verbose, status)

    implicit none
    character*(*) files
    logical verbose
    integer status

    !-----------------------------------------------------------------------
    ! Description: Gets the parameters from the stcal par file
    !
    ! Arguments:   files   (i): The value of the files parameter
    !              verbose (i): print info messages to screen
    !              status  (r): the success status of this routine
    !
    ! Origin:      Written for the Calibration Database
    !
    ! Authors/Modification history:
    ! Ron Zellar Sep 15 1994 -- Original Version
    !-----------------------------------------------------------------------
    !-

    integer errstat
    character(160) contxt

    !	Get the list of files to store
    call uclgst('files', files, errstat)
    if (errstat.ne.0) then
        contxt = 'Cannot get the files parameter'
        call fcerr(contxt)
        status = 1
        return
    endif

    !	Get the verbose parameter
    call uclgsb('verbose', verbose, errstat)
    if (errstat.ne.0) then
        contxt = 'Cannot get the verbose parameter'
        call fcerr(contxt)
        status = 2
        return
    endif

    return
end
