!     -*- f90 -*-
!     This file is autogenerated with f2py (version:2.2.4)
!     It contains Fortran 90 wrappers to fortran functions.

      subroutine f2py_elemmod_getdims_typ(r,s,f2pysetdata,flag)
      use elemmod, only: d => typ

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_typ
      subroutine f2py_elemmod_getdims_nelanz(r,s,f2pysetdata,flag)
      use elemmod, only: d => nelanz

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_nelanz
      subroutine f2py_elemmod_getdims_selanz(r,s,f2pysetdata,flag)
      use elemmod, only: d => selanz

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_selanz
      subroutine f2py_elemmod_getdims_snr(r,s,f2pysetdata,flag)
      use elemmod, only: d => snr

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_snr
      subroutine f2py_elemmod_getdims_sx(r,s,f2pysetdata,flag)
      use elemmod, only: d => sx

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_sx
      subroutine f2py_elemmod_getdims_sy(r,s,f2pysetdata,flag)
      use elemmod, only: d => sy

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_sy
      subroutine f2py_elemmod_getdims_spx(r,s,f2pysetdata,flag)
      use elemmod, only: d => spx

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_spx
      subroutine f2py_elemmod_getdims_spy(r,s,f2pysetdata,flag)
      use elemmod, only: d => spy

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_spy
      subroutine f2py_elemmod_getdims_nrel(r,s,f2pysetdata,flag)
      use elemmod, only: d => nrel

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1),s(2)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_nrel
      subroutine f2py_elemmod_getdims_rnr(r,s,f2pysetdata,flag)
      use elemmod, only: d => rnr

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_elemmod_getdims_rnr
      
      subroutine f2pyinitelemmod(f2pysetupfunc)
      use elemmod, only : sanz
      use elemmod, only : typanz
      use elemmod, only : mb
      use elemmod, only : typ
      use elemmod, only : nelanz
      use elemmod, only : selanz
      use elemmod, only : snr
      use elemmod, only : sx
      use elemmod, only : sy
      use elemmod, only : spx
      use elemmod, only : spy
      use elemmod, only : nrel
      use elemmod, only : elanz
      use elemmod, only : relanz
      use elemmod, only : rnr
      use elemmod, only : smaxs
      external f2pysetupfunc
      external f2py_elemmod_getdims_typ
      external f2py_elemmod_getdims_nelanz
      external f2py_elemmod_getdims_selanz
      external f2py_elemmod_getdims_snr
      external f2py_elemmod_getdims_sx
      external f2py_elemmod_getdims_sy
      external f2py_elemmod_getdims_spx
      external f2py_elemmod_getdims_spy
      external f2py_elemmod_getdims_nrel
      external f2py_elemmod_getdims_rnr
      call f2pysetupfunc(sanz,typanz,mb,f2py_elemmod_getdims_typ,f2py_el&
     &emmod_getdims_nelanz,f2py_elemmod_getdims_selanz,f2py_elemmod_getd&
     &ims_snr,f2py_elemmod_getdims_sx,f2py_elemmod_getdims_sy,f2py_elemm&
     &od_getdims_spx,f2py_elemmod_getdims_spy,f2py_elemmod_getdims_nrel,&
     &elanz,relanz,f2py_elemmod_getdims_rnr,smaxs)
      end subroutine f2pyinitelemmod

      subroutine f2py_electrmod_getdims_enr(r,s,f2pysetdata,flag)
      use electrmod, only: d => enr

      integer flag
      external f2pysetdata
      logical ns
      integer r,i
      integer(8) s(*)
      ns = .FALSE.
      if (allocated(d)) then
         do i=1,r
            if ((size(d,i).ne.s(i)).and.(s(i).ge.0)) then
               ns = .TRUE.
            end if
         end do
         if (ns) then
            deallocate(d)
         end if
      end if
      if ((.not.allocated(d)).and.(s(1).ge.1)) then
       allocate(d(s(1)))
      end if
      if (allocated(d)) then
         do i=1,r
            s(i) = size(d,i)
         end do
      end if
      flag = 1
      call f2pysetdata(d,allocated(d))
      end subroutine f2py_electrmod_getdims_enr
      
      subroutine f2pyinitelectrmod(f2pysetupfunc)
      use electrmod, only : eanz
      use electrmod, only : enr
      external f2pysetupfunc
      external f2py_electrmod_getdims_enr
      call f2pysetupfunc(eanz,f2py_electrmod_getdims_enr)
      end subroutine f2pyinitelectrmod

      
      subroutine f2pyiniterrmod(f2pysetupfunc)
      use errmod, only : errnr
      use errmod, only : errflag
      use errmod, only : fetxt
      external f2pysetupfunc
      call f2pysetupfunc(errnr,errflag,fetxt)
      end subroutine f2pyiniterrmod

      
      subroutine f2pyinitcmk(f2pysetupfunc)
      use cmk, only : run_cutmck
      external f2pysetupfunc
      call f2pysetupfunc(run_cutmck)
      end subroutine f2pyinitcmk


