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

      subroutine f2py_alloci_getdims_a(r,s,f2pysetdata,flag)
      use alloci, only: d => a

      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_alloci_getdims_a
      subroutine f2py_alloci_getdims_kpot(r,s,f2pysetdata,flag)
      use alloci, only: d => kpot

      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),s(3)))
      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_alloci_getdims_kpot
      subroutine f2py_alloci_getdims_hpot(r,s,f2pysetdata,flag)
      use alloci, only: d => hpot

      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_alloci_getdims_hpot
      subroutine f2py_alloci_getdims_sens(r,s,f2pysetdata,flag)
      use alloci, only: d => sens

      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_alloci_getdims_sens
      subroutine f2py_alloci_getdims_csens(r,s,f2pysetdata,flag)
      use alloci, only: d => csens

      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_alloci_getdims_csens
      subroutine f2py_alloci_getdims_adc(r,s,f2pysetdata,flag)
      use alloci, only: d => adc

      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_alloci_getdims_adc
      subroutine f2py_alloci_getdims_kpotdc(r,s,f2pysetdata,flag)
      use alloci, only: d => kpotdc

      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),s(3)))
      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_alloci_getdims_kpotdc
      subroutine f2py_alloci_getdims_hpotdc(r,s,f2pysetdata,flag)
      use alloci, only: d => hpotdc

      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_alloci_getdims_hpotdc
      subroutine f2py_alloci_getdims_sensdc(r,s,f2pysetdata,flag)
      use alloci, only: d => sensdc

      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_alloci_getdims_sensdc
      subroutine f2py_alloci_getdims_cov_d(r,s,f2pysetdata,flag)
      use alloci, only: d => cov_d

      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_alloci_getdims_cov_d
      subroutine f2py_alloci_getdims_smatm(r,s,f2pysetdata,flag)
      use alloci, only: d => smatm

      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_alloci_getdims_smatm
      subroutine f2py_alloci_getdims_rnd_r(r,s,f2pysetdata,flag)
      use alloci, only: d => rnd_r

      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_alloci_getdims_rnd_r
      subroutine f2py_alloci_getdims_rnd_p(r,s,f2pysetdata,flag)
      use alloci, only: d => rnd_p

      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_alloci_getdims_rnd_p
      subroutine f2py_alloci_getdims_ata(r,s,f2pysetdata,flag)
      use alloci, only: d => ata

      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_alloci_getdims_ata
      subroutine f2py_alloci_getdims_ata_reg(r,s,f2pysetdata,flag)
      use alloci, only: d => ata_reg

      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_alloci_getdims_ata_reg
      subroutine f2py_alloci_getdims_cov_m(r,s,f2pysetdata,flag)
      use alloci, only: d => cov_m

      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_alloci_getdims_cov_m
      
      subroutine f2pyinitalloci(f2pysetupfunc)
      use alloci, only : a
      use alloci, only : kpot
      use alloci, only : hpot
      use alloci, only : sens
      use alloci, only : csens
      use alloci, only : adc
      use alloci, only : kpotdc
      use alloci, only : hpotdc
      use alloci, only : sensdc
      use alloci, only : cov_d
      use alloci, only : smatm
      use alloci, only : rnd_r
      use alloci, only : rnd_p
      use alloci, only : ata
      use alloci, only : ata_reg
      use alloci, only : cov_m
      external f2pysetupfunc
      external f2py_alloci_getdims_a
      external f2py_alloci_getdims_kpot
      external f2py_alloci_getdims_hpot
      external f2py_alloci_getdims_sens
      external f2py_alloci_getdims_csens
      external f2py_alloci_getdims_adc
      external f2py_alloci_getdims_kpotdc
      external f2py_alloci_getdims_hpotdc
      external f2py_alloci_getdims_sensdc
      external f2py_alloci_getdims_cov_d
      external f2py_alloci_getdims_smatm
      external f2py_alloci_getdims_rnd_r
      external f2py_alloci_getdims_rnd_p
      external f2py_alloci_getdims_ata
      external f2py_alloci_getdims_ata_reg
      external f2py_alloci_getdims_cov_m
      call f2pysetupfunc(f2py_alloci_getdims_a,f2py_alloci_getdims_kpot,&
     &f2py_alloci_getdims_hpot,f2py_alloci_getdims_sens,f2py_alloci_getd&
     &ims_csens,f2py_alloci_getdims_adc,f2py_alloci_getdims_kpotdc,f2py_&
     &alloci_getdims_hpotdc,f2py_alloci_getdims_sensdc,f2py_alloci_getdi&
     &ms_cov_d,f2py_alloci_getdims_smatm,f2py_alloci_getdims_rnd_r,f2py_&
     &alloci_getdims_rnd_p,f2py_alloci_getdims_ata,f2py_alloci_getdims_a&
     &ta_reg,f2py_alloci_getdims_cov_m)
      end subroutine f2pyinitalloci

      subroutine f2py_datmod_getdims_strnr(r,s,f2pysetdata,flag)
      use datmod, only: d => strnr

      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_datmod_getdims_strnr
      subroutine f2py_datmod_getdims_strom(r,s,f2pysetdata,flag)
      use datmod, only: d => strom

      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_datmod_getdims_strom
      subroutine f2py_datmod_getdims_vnr(r,s,f2pysetdata,flag)
      use datmod, only: d => vnr

      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_datmod_getdims_vnr
      subroutine f2py_datmod_getdims_volt(r,s,f2pysetdata,flag)
      use datmod, only: d => volt

      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_datmod_getdims_volt
      subroutine f2py_datmod_getdims_sigmaa(r,s,f2pysetdata,flag)
      use datmod, only: d => sigmaa

      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_datmod_getdims_sigmaa
      subroutine f2py_datmod_getdims_sgmaa2(r,s,f2pysetdata,flag)
      use datmod, only: d => sgmaa2

      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_datmod_getdims_sgmaa2
      subroutine f2py_datmod_getdims_kfak(r,s,f2pysetdata,flag)
      use datmod, only: d => kfak

      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_datmod_getdims_kfak
      subroutine f2py_datmod_getdims_wmatdp(r,s,f2pysetdata,flag)
      use datmod, only: d => wmatdp

      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_datmod_getdims_wmatdp
      subroutine f2py_datmod_getdims_wmatdr(r,s,f2pysetdata,flag)
      use datmod, only: d => wmatdr

      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_datmod_getdims_wmatdr
      subroutine f2py_datmod_getdims_wmatd_cri(r,s,f2pysetdata,flag)
      use datmod, only: d => wmatd_cri

      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_datmod_getdims_wmatd_cri
      
      subroutine f2pyinitdatmod(f2pysetupfunc)
      use datmod, only : nanz
      use datmod, only : strnr
      use datmod, only : strom
      use datmod, only : vnr
      use datmod, only : volt
      use datmod, only : sigmaa
      use datmod, only : sgmaa2
      use datmod, only : kfak
      use datmod, only : wmatdp
      use datmod, only : wmatdr
      use datmod, only : wmatd_cri
      use datmod, only : stabw0
      use datmod, only : stabm0
      use datmod, only : stabp0
      use datmod, only : stabpa1
      use datmod, only : stabpb
      use datmod, only : stabpa2
      use datmod, only : lindiv
      use datmod, only : lratio
      use datmod, only : lpol
      use datmod, only : lnse
      use datmod, only : lnse2
      use datmod, only : iseed
      use datmod, only : nstabw0
      use datmod, only : nstabm0
      use datmod, only : nstabpb
      use datmod, only : nstabpa1
      use datmod, only : nstabpa2
      use datmod, only : nstabp0
      use datmod, only : npol
      external f2pysetupfunc
      external f2py_datmod_getdims_strnr
      external f2py_datmod_getdims_strom
      external f2py_datmod_getdims_vnr
      external f2py_datmod_getdims_volt
      external f2py_datmod_getdims_sigmaa
      external f2py_datmod_getdims_sgmaa2
      external f2py_datmod_getdims_kfak
      external f2py_datmod_getdims_wmatdp
      external f2py_datmod_getdims_wmatdr
      external f2py_datmod_getdims_wmatd_cri
      call f2pysetupfunc(nanz,f2py_datmod_getdims_strnr,f2py_datmod_getd&
     &ims_strom,f2py_datmod_getdims_vnr,f2py_datmod_getdims_volt,f2py_da&
     &tmod_getdims_sigmaa,f2py_datmod_getdims_sgmaa2,f2py_datmod_getdims&
     &_kfak,f2py_datmod_getdims_wmatdp,f2py_datmod_getdims_wmatdr,f2py_d&
     &atmod_getdims_wmatd_cri,stabw0,stabm0,stabp0,stabpa1,stabpb,stabpa&
     &2,lindiv,lratio,lpol,lnse,lnse2,iseed,nstabw0,nstabm0,nstabpb,nsta&
     &bpa1,nstabpa2,nstabp0,npol)
      end subroutine f2pyinitdatmod

      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 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_espx(r,s,f2pysetdata,flag)
      use elemmod, only: d => espx

      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_espx
      subroutine f2py_elemmod_getdims_espy(r,s,f2pysetdata,flag)
      use elemmod, only: d => espy

      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_espy
      subroutine f2py_elemmod_getdims_nachbar(r,s,f2pysetdata,flag)
      use elemmod, only: d => nachbar

      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_nachbar
      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 f2py_elemmod_getdims_xk(r,s,f2pysetdata,flag)
      use elemmod, only: d => xk

      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_xk
      subroutine f2py_elemmod_getdims_yk(r,s,f2pysetdata,flag)
      use elemmod, only: d => yk

      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_yk
      subroutine f2py_elemmod_getdims_elmam(r,s,f2pysetdata,flag)
      use elemmod, only: d => elmam

      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_elmam
      subroutine f2py_elemmod_getdims_elmas(r,s,f2pysetdata,flag)
      use elemmod, only: d => elmas

      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_elmas
      subroutine f2py_elemmod_getdims_elve(r,s,f2pysetdata,flag)
      use elemmod, only: d => elve

      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_elve
      subroutine f2py_elemmod_getdims_edecoup(r,s,f2pysetdata,flag)
      use elemmod, only: d => edecoup

      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_edecoup
      subroutine f2py_elemmod_getdims_edecstr(r,s,f2pysetdata,flag)
      use elemmod, only: d => edecstr

      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_edecstr
      subroutine f2py_elemmod_getdims_electrode_capacitances(r,s,f2pyset&
     &data,flag)
      use elemmod, only: d => electrode_capacitances

      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_electrode_capacitances
      
      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 : espx
      use elemmod, only : espy
      use elemmod, only : nachbar
      use elemmod, only : nrel
      use elemmod, only : elanz
      use elemmod, only : relanz
      use elemmod, only : rnr
      use elemmod, only : max_nr_element_nodes
      use elemmod, only : esp_min
      use elemmod, only : esp_max
      use elemmod, only : esp_mit
      use elemmod, only : esp_med
      use elemmod, only : esp_std
      use elemmod, only : grid_min
      use elemmod, only : grid_max
      use elemmod, only : grid_minx
      use elemmod, only : grid_miny
      use elemmod, only : grid_maxx
      use elemmod, only : grid_maxy
      use elemmod, only : lsink
      use elemmod, only : nsink
      use elemmod, only : lrandb2
      use elemmod, only : sytop
      use elemmod, only : xk
      use elemmod, only : yk
      use elemmod, only : elmam
      use elemmod, only : elmas
      use elemmod, only : elve
      use elemmod, only : decexi
      use elemmod, only : edecoup
      use elemmod, only : edecstr
      use elemmod, only : decanz
      use elemmod, only : nr_elec_capacitances
      use elemmod, only : elec_caps_file_exists
      use elemmod, only : electrode_capacitances
      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_espx
      external f2py_elemmod_getdims_espy
      external f2py_elemmod_getdims_nachbar
      external f2py_elemmod_getdims_nrel
      external f2py_elemmod_getdims_rnr
      external f2py_elemmod_getdims_xk
      external f2py_elemmod_getdims_yk
      external f2py_elemmod_getdims_elmam
      external f2py_elemmod_getdims_elmas
      external f2py_elemmod_getdims_elve
      external f2py_elemmod_getdims_edecoup
      external f2py_elemmod_getdims_edecstr
      external f2py_elemmod_getdims_electrode_capacitances
      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_espx,f2py_elemmod_getdims_espy,f2py_elemmod_getdims_nac&
     &hbar,f2py_elemmod_getdims_nrel,elanz,relanz,f2py_elemmod_getdims_r&
     &nr,max_nr_element_nodes,esp_min,esp_max,esp_mit,esp_med,esp_std,gr&
     &id_min,grid_max,grid_minx,grid_miny,grid_maxx,grid_maxy,lsink,nsin&
     &k,lrandb2,sytop,f2py_elemmod_getdims_xk,f2py_elemmod_getdims_yk,f2&
     &py_elemmod_getdims_elmam,f2py_elemmod_getdims_elmas,f2py_elemmod_g&
     &etdims_elve,decexi,f2py_elemmod_getdims_edecoup,f2py_elemmod_getdi&
     &ms_edecstr,decanz,nr_elec_capacitances,elec_caps_file_exists,f2py_&
     &elemmod_getdims_electrode_capacitances)
      end subroutine f2pyinitelemmod

      
      subroutine f2pyiniterrmod(f2pysetupfunc)
      use errmod, only : errnr
      use errmod, only : fperr
      use errmod, only : fprun
      use errmod, only : fpinv
      use errmod, only : fpcjg
      use errmod, only : fpeps
      use errmod, only : fpcfg
      use errmod, only : errflag
      use errmod, only : fetxt
      external f2pysetupfunc
      call f2pysetupfunc(errnr,fperr,fprun,fpinv,fpcjg,fpeps,fpcfg,errfl&
     &ag,fetxt)
      end subroutine f2pyiniterrmod

      subroutine f2py_femmod_getdims_pot(r,s,f2pysetdata,flag)
      use femmod, only: d => pot

      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_femmod_getdims_pot
      subroutine f2py_femmod_getdims_pota(r,s,f2pysetdata,flag)
      use femmod, only: d => pota

      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_femmod_getdims_pota
      subroutine f2py_femmod_getdims_b(r,s,f2pysetdata,flag)
      use femmod, only: d => b

      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_femmod_getdims_b
      subroutine f2py_femmod_getdims_bdc(r,s,f2pysetdata,flag)
      use femmod, only: d => bdc

      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_femmod_getdims_bdc
      subroutine f2py_femmod_getdims_fak(r,s,f2pysetdata,flag)
      use femmod, only: d => fak

      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_femmod_getdims_fak
      subroutine f2py_femmod_getdims_elbg(r,s,f2pysetdata,flag)
      use femmod, only: d => elbg

      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),s(3)))
      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_femmod_getdims_elbg
      subroutine f2py_femmod_getdims_relbg(r,s,f2pysetdata,flag)
      use femmod, only: d => relbg

      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_femmod_getdims_relbg
      subroutine f2py_femmod_getdims_kg(r,s,f2pysetdata,flag)
      use femmod, only: d => kg

      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),s(3)))
      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_femmod_getdims_kg
      
      subroutine f2pyinitfemmod(f2pysetupfunc)
      use femmod, only : pot
      use femmod, only : pota
      use femmod, only : b
      use femmod, only : bdc
      use femmod, only : fak
      use femmod, only : elbg
      use femmod, only : relbg
      use femmod, only : kg
      use femmod, only : lbeta
      use femmod, only : lrandb
      use femmod, only : lsr
      use femmod, only : ldc
      external f2pysetupfunc
      external f2py_femmod_getdims_pot
      external f2py_femmod_getdims_pota
      external f2py_femmod_getdims_b
      external f2py_femmod_getdims_bdc
      external f2py_femmod_getdims_fak
      external f2py_femmod_getdims_elbg
      external f2py_femmod_getdims_relbg
      external f2py_femmod_getdims_kg
      call f2pysetupfunc(f2py_femmod_getdims_pot,f2py_femmod_getdims_pot&
     &a,f2py_femmod_getdims_b,f2py_femmod_getdims_bdc,f2py_femmod_getdim&
     &s_fak,f2py_femmod_getdims_elbg,f2py_femmod_getdims_relbg,f2py_femm&
     &od_getdims_kg,lbeta,lrandb,lsr,ldc)
      end subroutine f2pyinitfemmod

      subroutine f2py_invmod_getdims_dat(r,s,f2pysetdata,flag)
      use invmod, only: d => dat

      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_invmod_getdims_dat
      subroutine f2py_invmod_getdims_par(r,s,f2pysetdata,flag)
      use invmod, only: d => par

      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_invmod_getdims_par
      subroutine f2py_invmod_getdims_dpar(r,s,f2pysetdata,flag)
      use invmod, only: d => dpar

      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_invmod_getdims_dpar
      subroutine f2py_invmod_getdims_dpar2(r,s,f2pysetdata,flag)
      use invmod, only: d => dpar2

      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_invmod_getdims_dpar2
      subroutine f2py_invmod_getdims_d0(r,s,f2pysetdata,flag)
      use invmod, only: d => d0

      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_invmod_getdims_d0
      subroutine f2py_invmod_getdims_m0(r,s,f2pysetdata,flag)
      use invmod, only: d => m0

      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_invmod_getdims_m0
      subroutine f2py_invmod_getdims_fm0(r,s,f2pysetdata,flag)
      use invmod, only: d => fm0

      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_invmod_getdims_fm0
      subroutine f2py_invmod_getdims_m_ref(r,s,f2pysetdata,flag)
      use invmod, only: d => m_ref

      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_invmod_getdims_m_ref
      subroutine f2py_invmod_getdims_wmatd(r,s,f2pysetdata,flag)
      use invmod, only: d => wmatd

      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_invmod_getdims_wmatd
      subroutine f2py_invmod_getdims_wmatd2(r,s,f2pysetdata,flag)
      use invmod, only: d => wmatd2

      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_invmod_getdims_wmatd2
      subroutine f2py_invmod_getdims_wdfak(r,s,f2pysetdata,flag)
      use invmod, only: d => wdfak

      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_invmod_getdims_wdfak
      subroutine f2py_invmod_getdims_wmfak(r,s,f2pysetdata,flag)
      use invmod, only: d => wmfak

      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_invmod_getdims_wmfak
      
      subroutine f2pyinitinvmod(f2pysetupfunc)
      use invmod, only : dat
      use invmod, only : par
      use invmod, only : dpar
      use invmod, only : dpar2
      use invmod, only : d0
      use invmod, only : m0
      use invmod, only : fm0
      use invmod, only : m_ref
      use invmod, only : wmatd
      use invmod, only : wmatd2
      use invmod, only : par_vari
      use invmod, only : wdfak
      use invmod, only : lfpi
      use invmod, only : wmfak
      external f2pysetupfunc
      external f2py_invmod_getdims_dat
      external f2py_invmod_getdims_par
      external f2py_invmod_getdims_dpar
      external f2py_invmod_getdims_dpar2
      external f2py_invmod_getdims_d0
      external f2py_invmod_getdims_m0
      external f2py_invmod_getdims_fm0
      external f2py_invmod_getdims_m_ref
      external f2py_invmod_getdims_wmatd
      external f2py_invmod_getdims_wmatd2
      external f2py_invmod_getdims_wdfak
      external f2py_invmod_getdims_wmfak
      call f2pysetupfunc(f2py_invmod_getdims_dat,f2py_invmod_getdims_par&
     &,f2py_invmod_getdims_dpar,f2py_invmod_getdims_dpar2,f2py_invmod_ge&
     &tdims_d0,f2py_invmod_getdims_m0,f2py_invmod_getdims_fm0,f2py_invmo&
     &d_getdims_m_ref,f2py_invmod_getdims_wmatd,f2py_invmod_getdims_wmat&
     &d2,par_vari,f2py_invmod_getdims_wdfak,lfpi,f2py_invmod_getdims_wmf&
     &ak)
      end subroutine f2pyinitinvmod

      
      subroutine f2pyinitkonvmod(f2pysetupfunc)
      use konvmod, only : lam
      use konvmod, only : lammax
      use konvmod, only : lam_cri
      use konvmod, only : lamnull_cri
      use konvmod, only : lamnull_fpi
      use konvmod, only : lam_ref
      use konvmod, only : lam_ref_sw
      use konvmod, only : lamfix
      use konvmod, only : dlam
      use konvmod, only : dlalt
      use konvmod, only : nlam
      use konvmod, only : alam
      use konvmod, only : fstart
      use konvmod, only : fstop
      use konvmod, only : step
      use konvmod, only : stpalt
      use konvmod, only : stpmin
      use konvmod, only : llam
      use konvmod, only : lstep
      use konvmod, only : ldlami
      use konvmod, only : ldlamf
      use konvmod, only : llamf
      use konvmod, only : lfstep
      use konvmod, only : nrmsd
      use konvmod, only : rmsalt
      use konvmod, only : rmsreg
      use konvmod, only : rmssum
      use konvmod, only : betrms
      use konvmod, only : pharms
      use konvmod, only : rough
      use konvmod, only : nrmsdm
      use konvmod, only : mqrms
      use konvmod, only : l1min
      use konvmod, only : l1rat
      use konvmod, only : bdpar
      use konvmod, only : bdmin
      use konvmod, only : nx
      use konvmod, only : nz
      use konvmod, only : itmax
      use konvmod, only : it
      use konvmod, only : itr
      use konvmod, only : alfx
      use konvmod, only : alfz
      use konvmod, only : betamgs
      use konvmod, only : lrobust
      use konvmod, only : ldiff
      use konvmod, only : lphi0
      use konvmod, only : lfphai
      use konvmod, only : lffhom
      use konvmod, only : ltri
      use konvmod, only : lprior
      use konvmod, only : lw_ref
      use konvmod, only : lnsepri
      use konvmod, only : lsens
      use konvmod, only : lres
      use konvmod, only : lcov1
      use konvmod, only : lcov2
      use konvmod, only : mswitch
      use konvmod, only : lgauss
      use konvmod, only : lvario
      use konvmod, only : lverb
      use konvmod, only : lverb_dat
      use konvmod, only : lsytop
      use konvmod, only : lelerr
      external f2pysetupfunc
      call f2pysetupfunc(lam,lammax,lam_cri,lamnull_cri,lamnull_fpi,lam_&
     &ref,lam_ref_sw,lamfix,dlam,dlalt,nlam,alam,fstart,fstop,step,stpal&
     &t,stpmin,llam,lstep,ldlami,ldlamf,llamf,lfstep,nrmsd,rmsalt,rmsreg&
     &,rmssum,betrms,pharms,rough,nrmsdm,mqrms,l1min,l1rat,bdpar,bdmin,n&
     &x,nz,itmax,it,itr,alfx,alfz,betamgs,lrobust,ldiff,lphi0,lfphai,lff&
     &hom,ltri,lprior,lw_ref,lnsepri,lsens,lres,lcov1,lcov2,mswitch,lgau&
     &ss,lvario,lverb,lverb_dat,lsytop,lelerr)
      end subroutine f2pyinitkonvmod

      subroutine f2py_modelmod_getdims_mnr(r,s,f2pysetdata,flag)
      use modelmod, only: d => mnr

      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_modelmod_getdims_mnr
      subroutine f2py_modelmod_getdims_w_ref_re(r,s,f2pysetdata,flag)
      use modelmod, only: d => w_ref_re

      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_modelmod_getdims_w_ref_re
      subroutine f2py_modelmod_getdims_w_ref_im(r,s,f2pysetdata,flag)
      use modelmod, only: d => w_ref_im

      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_modelmod_getdims_w_ref_im
      subroutine f2py_modelmod_getdims_ind_ref_grad(r,s,f2pysetdata,flag&
     &)
      use modelmod, only: d => ind_ref_grad

      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_modelmod_getdims_ind_ref_grad
      
      subroutine f2pyinitmodelmod(f2pysetupfunc)
      use modelmod, only : manz
      use modelmod, only : mnr
      use modelmod, only : w_ref_re
      use modelmod, only : w_ref_im
      use modelmod, only : ind_ref_grad
      external f2pysetupfunc
      external f2py_modelmod_getdims_mnr
      external f2py_modelmod_getdims_w_ref_re
      external f2py_modelmod_getdims_w_ref_im
      external f2py_modelmod_getdims_ind_ref_grad
      call f2pysetupfunc(manz,f2py_modelmod_getdims_mnr,f2py_modelmod_ge&
     &tdims_w_ref_re,f2py_modelmod_getdims_w_ref_im,f2py_modelmod_getdim&
     &s_ind_ref_grad)
      end subroutine f2pyinitmodelmod

      
      subroutine f2pyinitpathmod(f2pysetupfunc)
      use pathmod, only : slash
      use pathmod, only : ramd
      use pathmod, only : lnramd
      use pathmod, only : mkdir_cmd
      use pathmod, only : rmdir
      use pathmod, only : clear_string
      external f2pysetupfunc
      call f2pysetupfunc(slash,ramd,lnramd,mkdir_cmd,rmdir,clear_string)
      end subroutine f2pyinitpathmod

      subroutine f2py_randbmod_getdims_rwdnr(r,s,f2pysetdata,flag)
      use randbmod, only: d => rwdnr

      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_randbmod_getdims_rwdnr
      subroutine f2py_randbmod_getdims_rwddc(r,s,f2pysetdata,flag)
      use randbmod, only: d => rwddc

      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_randbmod_getdims_rwddc
      subroutine f2py_randbmod_getdims_rwd(r,s,f2pysetdata,flag)
      use randbmod, only: d => rwd

      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_randbmod_getdims_rwd
      subroutine f2py_randbmod_getdims_rwndc(r,s,f2pysetdata,flag)
      use randbmod, only: d => rwndc

      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_randbmod_getdims_rwndc
      subroutine f2py_randbmod_getdims_rwn(r,s,f2pysetdata,flag)
      use randbmod, only: d => rwn

      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_randbmod_getdims_rwn
      
      subroutine f2pyinitrandbmod(f2pysetupfunc)
      use randbmod, only : rwdanz
      use randbmod, only : rwdnr
      use randbmod, only : rwddc
      use randbmod, only : rwd
      use randbmod, only : rwdbnr
      use randbmod, only : rwnanz
      use randbmod, only : rwndc
      use randbmod, only : rwn
      external f2pysetupfunc
      external f2py_randbmod_getdims_rwdnr
      external f2py_randbmod_getdims_rwddc
      external f2py_randbmod_getdims_rwd
      external f2py_randbmod_getdims_rwndc
      external f2py_randbmod_getdims_rwn
      call f2pysetupfunc(rwdanz,f2py_randbmod_getdims_rwdnr,f2py_randbmo&
     &d_getdims_rwddc,f2py_randbmod_getdims_rwd,rwdbnr,rwnanz,f2py_randb&
     &mod_getdims_rwndc,f2py_randbmod_getdims_rwn)
      end subroutine f2pyinitrandbmod

      subroutine f2py_sigmamod_getdims_sigma(r,s,f2pysetdata,flag)
      use sigmamod, only: d => sigma

      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_sigmamod_getdims_sigma
      subroutine f2py_sigmamod_getdims_sigma2(r,s,f2pysetdata,flag)
      use sigmamod, only: d => sigma2

      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_sigmamod_getdims_sigma2
      
      subroutine f2pyinitsigmamod(f2pysetupfunc)
      use sigmamod, only : sigma0
      use sigmamod, only : sigma
      use sigmamod, only : sigma2
      use sigmamod, only : bet0
      use sigmamod, only : pha0
      use sigmamod, only : lrho0
      use sigmamod, only : lstart
      use sigmamod, only : iseedpri
      use sigmamod, only : modl_stdn
      external f2pysetupfunc
      external f2py_sigmamod_getdims_sigma
      external f2py_sigmamod_getdims_sigma2
      call f2pysetupfunc(sigma0,f2py_sigmamod_getdims_sigma,f2py_sigmamo&
     &d_getdims_sigma2,bet0,pha0,lrho0,lstart,iseedpri,modl_stdn)
      end subroutine f2pyinitsigmamod

      subroutine f2py_wavenmod_getdims_kwn(r,s,f2pysetdata,flag)
      use wavenmod, only: d => kwn

      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_wavenmod_getdims_kwn
      subroutine f2py_wavenmod_getdims_kwnwi(r,s,f2pysetdata,flag)
      use wavenmod, only: d => kwnwi

      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_wavenmod_getdims_kwnwi
      
      subroutine f2pyinitwavenmod(f2pysetupfunc)
      use wavenmod, only : kwnanz
      use wavenmod, only : swrtr
      use wavenmod, only : kwn
      use wavenmod, only : kwnwi
      use wavenmod, only : amin
      use wavenmod, only : amax
      external f2pysetupfunc
      external f2py_wavenmod_getdims_kwn
      external f2py_wavenmod_getdims_kwnwi
      call f2pysetupfunc(kwnanz,swrtr,f2py_wavenmod_getdims_kwn,f2py_wav&
     &enmod_getdims_kwnwi,amin,amax)
      end subroutine f2pyinitwavenmod

      
      subroutine f2pyinitget_ver(f2pysetupfunc)
      use get_ver, only : version
      external f2pysetupfunc
      call f2pysetupfunc(version)
      end subroutine f2pyinitget_ver

      
      subroutine f2pyinitompmod(f2pysetupfunc)
      use ompmod, only : tid
      use ompmod, only : nthreads
      use ompmod, only : chunk_0
      use ompmod, only : chunk_1
      use ompmod, only : chunk_2
      use ompmod, only : chunk_3
      external f2pysetupfunc
      call f2pysetupfunc(tid,nthreads,chunk_0,chunk_1,chunk_2,chunk_3)
      end subroutine f2pyinitompmod

      
      subroutine f2pyinitmake_noise(f2pysetupfunc)
      use make_noise, only : f2py_fix
      external f2pysetupfunc
      call f2pysetupfunc(f2py_fix)
      end subroutine f2pyinitmake_noise

      
      subroutine f2pyinittic_toc(f2pysetupfunc)
      use tic_toc, only : fix_f2py
      external f2pysetupfunc
      call f2pysetupfunc(fix_f2py)
      end subroutine f2pyinittic_toc

      subroutine f2py_cjgmod_getdims_ap(r,s,f2pysetdata,flag)
      use cjgmod, only: d => ap

      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_cjgmod_getdims_ap
      subroutine f2py_cjgmod_getdims_bvec(r,s,f2pysetdata,flag)
      use cjgmod, only: d => bvec

      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_cjgmod_getdims_bvec
      subroutine f2py_cjgmod_getdims_rvec(r,s,f2pysetdata,flag)
      use cjgmod, only: d => rvec

      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_cjgmod_getdims_rvec
      subroutine f2py_cjgmod_getdims_pvec(r,s,f2pysetdata,flag)
      use cjgmod, only: d => pvec

      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_cjgmod_getdims_pvec
      subroutine f2py_cjgmod_getdims_apdc(r,s,f2pysetdata,flag)
      use cjgmod, only: d => apdc

      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_cjgmod_getdims_apdc
      subroutine f2py_cjgmod_getdims_bvecdc(r,s,f2pysetdata,flag)
      use cjgmod, only: d => bvecdc

      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_cjgmod_getdims_bvecdc
      subroutine f2py_cjgmod_getdims_rvecdc(r,s,f2pysetdata,flag)
      use cjgmod, only: d => rvecdc

      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_cjgmod_getdims_rvecdc
      subroutine f2py_cjgmod_getdims_pvecdc(r,s,f2pysetdata,flag)
      use cjgmod, only: d => pvecdc

      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_cjgmod_getdims_pvecdc
      subroutine f2py_cjgmod_getdims_cgres(r,s,f2pysetdata,flag)
      use cjgmod, only: d => cgres

      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_cjgmod_getdims_cgres
      subroutine f2py_cjgmod_getdims_cgres2(r,s,f2pysetdata,flag)
      use cjgmod, only: d => cgres2

      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_cjgmod_getdims_cgres2
      subroutine f2py_cjgmod_getdims_cgfac(r,s,f2pysetdata,flag)
      use cjgmod, only: d => cgfac

      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_cjgmod_getdims_cgfac
      
      subroutine f2pyinitcjgmod(f2pysetupfunc)
      use cjgmod, only : ap
      use cjgmod, only : bvec
      use cjgmod, only : rvec
      use cjgmod, only : pvec
      use cjgmod, only : apdc
      use cjgmod, only : bvecdc
      use cjgmod, only : rvecdc
      use cjgmod, only : pvecdc
      use cjgmod, only : cgres
      use cjgmod, only : cgres2
      use cjgmod, only : cgfac
      use cjgmod, only : eps
      use cjgmod, only : ncgmax
      use cjgmod, only : ncg
      external f2pysetupfunc
      external f2py_cjgmod_getdims_ap
      external f2py_cjgmod_getdims_bvec
      external f2py_cjgmod_getdims_rvec
      external f2py_cjgmod_getdims_pvec
      external f2py_cjgmod_getdims_apdc
      external f2py_cjgmod_getdims_bvecdc
      external f2py_cjgmod_getdims_rvecdc
      external f2py_cjgmod_getdims_pvecdc
      external f2py_cjgmod_getdims_cgres
      external f2py_cjgmod_getdims_cgres2
      external f2py_cjgmod_getdims_cgfac
      call f2pysetupfunc(f2py_cjgmod_getdims_ap,f2py_cjgmod_getdims_bvec&
     &,f2py_cjgmod_getdims_rvec,f2py_cjgmod_getdims_pvec,f2py_cjgmod_get&
     &dims_apdc,f2py_cjgmod_getdims_bvecdc,f2py_cjgmod_getdims_rvecdc,f2&
     &py_cjgmod_getdims_pvecdc,f2py_cjgmod_getdims_cgres,f2py_cjgmod_get&
     &dims_cgres2,f2py_cjgmod_getdims_cgfac,eps,ncgmax,ncg)
      end subroutine f2pyinitcjgmod

      
      subroutine f2pyinitinvhpmod(f2pysetupfunc)
      use invhpmod, only : kanal
      use invhpmod, only : delem
      use invhpmod, only : delectr
      use invhpmod, only : dstrom
      use invhpmod, only : dsigma
      use invhpmod, only : dvolt
      use invhpmod, only : dsens
      use invhpmod, only : dstart
      use invhpmod, only : dd0
      use invhpmod, only : dm0
      use invhpmod, only : dfm0
      use invhpmod, only : drandb
      use invhpmod, only : lsetup
      use invhpmod, only : lsetip
      use invhpmod, only : lagain
      use invhpmod, only : j
      use invhpmod, only : k
      use invhpmod, only : l
      use invhpmod, only : izeit
      use invhpmod, only : tazeit
      use invhpmod, only : errnr2
      external f2pysetupfunc
      call f2pysetupfunc(kanal,delem,delectr,dstrom,dsigma,dvolt,dsens,d&
     &start,dd0,dm0,dfm0,drandb,lsetup,lsetip,lagain,j,k,l,izeit,tazeit,&
     &errnr2)
      end subroutine f2pyinitinvhpmod

      
      subroutine f2pyinitbsmatm_mod(f2pysetupfunc)
      use bsmatm_mod, only : p
      external f2pysetupfunc
      call f2pysetupfunc(p)
      end subroutine f2pyinitbsmatm_mod

      
      subroutine f2pyinitpyinv(f2pysetupfunc)
      use pyinv, only : invertpy
      external f2pysetupfunc
      call f2pysetupfunc(invertpy)
      end subroutine f2pyinitpyinv


