      SUBROUTINE CREEP(DECRA,DESWA,STATEV,SERD,EC,ESW,P,QTILD,
     1 TEMP,DTEMP,PREDEF,DPRED,TIME,DTIME,CMNAME,LEXIMP,LEND,
     2 COORDS,NSTATV,NOEL,NPT,LAYER,KSPT,KSTEP,KINC)
C
      INCLUDE 'ABA_PARAM.INC'
C
      CHARACTER*80 CMNAME
C
      DIMENSION DECRA(5),DESWA(5),STATEV(*),PREDEF(*),DPRED(*),
     1 TIME(3),COORDS(*),EC(2),ESW(2)
C
      PARAMETER(ri=6.9D0, ro=7.75D0)
      DOUBLE PRECISION AA, pp, mm, nn, Ea, R, dd, pO2_1, pO2_2, pO2
C
      TEMP = TEMP + 273.15	           ! [K] Temperature
      X=COORDS(1)
      Y=COORDS(2)
      Z=COORDS(3)
      AA=2.3*10**2.1 !unit mm^1.7/(MPa^1.56*s)
      pp=1.7D0 ! exponent für Korngröße
      mm=-0.14D0 ! exponent für pO2
      nn=1.7D0  ! exponent für (von Mises) Spannung 
      Ea=338D6 !mj/mol
      R= 8.314D3 !mj/(mol*K)
      dd=18D-3 !mm
      pO2_1=2.D-2 !MPa Luftseite r=7.75
      pO2_2=5.D-3 !MPa Innenseite r=6.9
C
      if (KSTEP.Eq.2 .AND. Y.GE.ro) then
          pO2=(pO2_2-pO2_1)/(ri-ro)*(sqrt(X**2+Z**2)-ro)
     +         +pO2_1
      else if (KSTEP.EQ.2 .AND. Y.LT.ro) then
          pO2=(pO2_2-pO2_1)/(ri-ro)*(sqrt(X**2+(Y-ro)**2
     +          +Z**2)-ro)+pO2_1
      end if 
      
      DECRA(1) = AA*(1/dd)**pp*pO2**mm*QTILD**nn*exp(-Ea/(R*TEMP))*DTIME
      IF(LEXIMP.EQ.1) THEN
       DECRA(5) = nn*AA*(1/dd)**pp*pO2**mm*QTILD**(nn-1)*           
     +      exp(-Ea/(R*TEMP))*DTIME
      END IF
	  STATEV(1)=pO2
      TEMP = TEMP - 273.15	           ! [K] Temperature
C
      RETURN
      END
	  
      SUBROUTINE USDFLD(FIELD,STATEV,PNEWDT,DIRECT,T,CELENT,
     1 TIME,DTIME,CMNAME,ORNAME,NFIELD,NSTATV,NOEL,NPT,LAYER,
     2 KSPT,KSTEP,KINC,NDI,NSHR,COORD,JMAC,JMATYP,MATLAYO,
     3 LACCFLA)
C
      INCLUDE 'ABA_PARAM.INC'
C
      CHARACTER*80 CMNAME,ORNAME
      CHARACTER*3  FLGRAY(15)
      DIMENSION FIELD(NFIELD),STATEV(NSTATV),DIRECT(3,3),
     1 T(3,3),TIME(2)
      DIMENSION ARRAY(15),JARRAY(15),JMAC(*),JMATYP(*),
     1 COORD(*)
      PARAMETER(ri=6.9D0, ro=7.75D0, tt=120.D0)
C
      X=COORD(1)
      Y=COORD(2)
      Z=COORD(3)
      
      if (KSTEP.Lt.3 .AND. Y.GE.ro) then
          FIELD(1)=-1/(ro-ri)*(sqrt(X**2+Z**2)-ro)
      else if (KSTEP.Lt.3 .AND. Y.LT.ro) then
          FIELD(1)=-1/(ro-ri)*(sqrt(X**2+(Y-7.75)**2+Z**2)-ro)
      else if (KSTEP.eq.3 .AND. Y.GE.ro) then
          FIELD(1)=-1/(ro-ri)*(sqrt(X**2+Z**2)-7.75)*(1-TIME(1)/tt)
      else if (KSTEP.eq.3 .AND. Y.LT.ro) then
          FIELD(1)=-1/(ro-ri)*(sqrt(X**2+(Y-7.75)**2+Z**2)-ro)
     +    *(1-TIME(1)/tt)
      end if   
      
      STATEV(2)=FIELD(1)*2.76D-6+19.47D-6
C
      RETURN
      END
