UPROP  - - Example

    uprop.f is a file in the user directory that allows one to define different load curves for FEAP's proportional loading functions.  Normally in FEAP on is restricted to the built in load curves or to the use of load tables to define loads.  Occasionally this can be inconvenient and the uprop feature allows one to program in one's own loading function.  This example shows how this can be done to program in a haversine function such as the one used in the analysis of pavements.  The source file was provided by Fenella Long in the UCB asphalt pavement research group.

    The are two things that have to be programed:     To use your new load curve you need tell FEAP that the load curve is to be a user load curve.  The basic input deck format is

        unumb type tmin tmax ap(1) ap(2) ap(3) ap(4) ap(5)

    Note that once you say `prop,user' then the meaning of the first 2 parameters and the last 5 is entirely up to you.  FEAP will only make use of the tmin tmax parameters by deciding when to call your load function.

    An example uprop.f for the Haversine is shown below.  For the Haversine function implementation shown unumb needs to be = 1 and type is simply ignored.

Source file:

c$Id: uprop.f,v 1.2 2000/09/26 18:09:05 rlt Exp $
      subroutine uprop(unumb,type,tmin,tmax,ap, t,upropld, isw)

c      Purpose: User proportional load routine

c      Inputs:
c        unumb   - User function number
c        type    - User type definition
c        tmin    - Minimum time applicable
c        tmax    - Maximum time applicable
c        ap(5)   - User function parameters
c        t       - Current time for evaluation point

c        HAVERSINE parameters
c        ap(2) =  frequency
c        ap(3) =  Pulse magnitude
c        ap(4) =  Pulse period
c        ap(5) =  Rest period

c      Output:
c        upropld - Value of proportional load
      implicit   none

      include   'iofile.h'

      integer    unumb,type, isw, inttimex,i
      real*8     tmin, tmax, ap(5), t, upropld
      real*8     timex, tfunc, pi, freq, load
      real*8     ton, toff, tcycle


c     Print output of user data for isw=1

      if(isw.eq.1) then

c     This implementation of uprop ignores ap(1)

        write(iow,2000) (ap(i),i=2,5)
        if (ior.lt.0) then
          write(*,2000) (ap(i),i=2,5)

c.... Format Statements
2000  format(9x,'** H A V E R S I N E   L O A D I N G**',//,
     #       5x,'Frequency                   ',1pe10.3,/
     #       5x,'Proportion of load at peak  ',1pe10.3,/
     #       5x,'Time loading and unloading  ',1pe10.3,/
     #       5x,'Rest period                 ',1pe10.3,/)

c     Compute function value for 'upropld' when isw=2

      elseif (isw.eq.2) then

c      Compute load for unumb function = 1, does not make use of type

       if(unumb.eq.1) then  ! The Haversine

        ! read parameters input
        pi   = 4.d0*atan(1.d0)
        freq = ap(2)
        load = ap(3)
        ton  = ap(4)
        toff = ap(5)

       ! calculate factors to determine in haversine or rest
        tcycle   = ton + toff
        timex    = t / tcycle
        inttimex = int(timex)
        tfunc    = (timex - inttimex)*tcycle

        ! get relevant load for time first print warnings for unexpected
        ! values of tfunc which should never happen
        if (tfunc < 0.0d0) then
              write(*,*) '***WARNING***   tfunc<0'
          else if (tfunc >= tcycle) then
              write(*,*) '***WARNING***   tfunc>tcycle'

          else if (tfunc <= ton) then
             ! In the pulse

          else if (tfunc < tcycle) then
              ! During the rest period

              write(*,*) '***WARNING***   no tfunc operation'