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

      subroutine f2py_apxshmodule_getdims_coeff0(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => coeff0

      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_apxshmodule_getdims_coeff0
      subroutine f2py_apxshmodule_getdims_qcoeff0(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => qcoeff0

      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_apxshmodule_getdims_qcoeff0
      subroutine f2py_apxshmodule_getdims_gcoeff0(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => gcoeff0

      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_apxshmodule_getdims_gcoeff0
      subroutine f2py_apxshmodule_getdims_xqcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => xqcoeff

      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_apxshmodule_getdims_xqcoeff
      subroutine f2py_apxshmodule_getdims_yqcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => yqcoeff

      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_apxshmodule_getdims_yqcoeff
      subroutine f2py_apxshmodule_getdims_zqcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => zqcoeff

      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_apxshmodule_getdims_zqcoeff
      subroutine f2py_apxshmodule_getdims_dxqdrhocoeff(r,s,f2pysetdata,f&
     &lag)
      use apxshmodule, only: d => dxqdrhocoeff

      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_apxshmodule_getdims_dxqdrhocoeff
      subroutine f2py_apxshmodule_getdims_dyqdrhocoeff(r,s,f2pysetdata,f&
     &lag)
      use apxshmodule, only: d => dyqdrhocoeff

      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_apxshmodule_getdims_dyqdrhocoeff
      subroutine f2py_apxshmodule_getdims_dzqdrhocoeff(r,s,f2pysetdata,f&
     &lag)
      use apxshmodule, only: d => dzqdrhocoeff

      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_apxshmodule_getdims_dzqdrhocoeff
      subroutine f2py_apxshmodule_getdims_xgcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => xgcoeff

      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_apxshmodule_getdims_xgcoeff
      subroutine f2py_apxshmodule_getdims_ygcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => ygcoeff

      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_apxshmodule_getdims_ygcoeff
      subroutine f2py_apxshmodule_getdims_zgcoeff(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => zgcoeff

      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_apxshmodule_getdims_zgcoeff
      subroutine f2py_apxshmodule_getdims_sh(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => sh

      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_apxshmodule_getdims_sh
      subroutine f2py_apxshmodule_getdims_shgradtheta(r,s,f2pysetdata,fl&
     &ag)
      use apxshmodule, only: d => shgradtheta

      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_apxshmodule_getdims_shgradtheta
      subroutine f2py_apxshmodule_getdims_shgradphi(r,s,f2pysetdata,flag&
     &)
      use apxshmodule, only: d => shgradphi

      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_apxshmodule_getdims_shgradphi
      subroutine f2py_apxshmodule_getdims_polynomq(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => polynomq

      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_apxshmodule_getdims_polynomq
      subroutine f2py_apxshmodule_getdims_dpolynomq(r,s,f2pysetdata,flag&
     &)
      use apxshmodule, only: d => dpolynomq

      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_apxshmodule_getdims_dpolynomq
      subroutine f2py_apxshmodule_getdims_polynomg(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => polynomg

      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_apxshmodule_getdims_polynomg
      subroutine f2py_apxshmodule_getdims_pbar(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => pbar

      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_apxshmodule_getdims_pbar
      subroutine f2py_apxshmodule_getdims_vbar(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => vbar

      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_apxshmodule_getdims_vbar
      subroutine f2py_apxshmodule_getdims_wbar(r,s,f2pysetdata,flag)
      use apxshmodule, only: d => wbar

      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_apxshmodule_getdims_wbar
      subroutine f2py_apxshmodule_getdims_epochgrid(r,s,f2pysetdata,flag&
     &)
      use apxshmodule, only: d => epochgrid

      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_apxshmodule_getdims_epochgrid
      
      subroutine f2pyinitapxshmodule(f2pysetupfunc)
      use apxshmodule, only : nterm
      use apxshmodule, only : nmax
      use apxshmodule, only : mmax
      use apxshmodule, only : lmax
      use apxshmodule, only : nepoch
      use apxshmodule, only : ntermsh
      use apxshmodule, only : vecflag
      use apxshmodule, only : coeff0
      use apxshmodule, only : qcoeff0
      use apxshmodule, only : gcoeff0
      use apxshmodule, only : xqcoeff
      use apxshmodule, only : yqcoeff
      use apxshmodule, only : zqcoeff
      use apxshmodule, only : dxqdrhocoeff
      use apxshmodule, only : dyqdrhocoeff
      use apxshmodule, only : dzqdrhocoeff
      use apxshmodule, only : xgcoeff
      use apxshmodule, only : ygcoeff
      use apxshmodule, only : zgcoeff
      use apxshmodule, only : sh
      use apxshmodule, only : shgradtheta
      use apxshmodule, only : shgradphi
      use apxshmodule, only : polynomq
      use apxshmodule, only : dpolynomq
      use apxshmodule, only : polynomg
      use apxshmodule, only : pbar
      use apxshmodule, only : vbar
      use apxshmodule, only : wbar
      use apxshmodule, only : epochgrid
      use apxshmodule, only : h
      use apxshmodule, only : reph
      use apxshmodule, only : rho
      use apxshmodule, only : xq
      use apxshmodule, only : yq
      use apxshmodule, only : zq
      use apxshmodule, only : qlat
      use apxshmodule, only : qlon
      use apxshmodule, only : sinqlat
      use apxshmodule, only : cosqlat
      use apxshmodule, only : cosqlon
      use apxshmodule, only : sinqlon
      use apxshmodule, only : xqgrad
      use apxshmodule, only : yqgrad
      use apxshmodule, only : zqgrad
      use apxshmodule, only : qlatgrad
      use apxshmodule, only : qlongrad
      use apxshmodule, only : pi
      use apxshmodule, only : dtor
      use apxshmodule, only : pid2
      use apxshmodule, only : twopi
      use apxshmodule, only : req
      use apxshmodule, only : eps
      use apxshmodule, only : re
      use apxshmodule, only : ecc2
      use apxshmodule, only : missing
      use apxshmodule, only : datafile
      use apxshmodule, only : epoch
      use apxshmodule, only : altlastq
      use apxshmodule, only : altlastg
      use apxshmodule, only : loadflag
      external f2pysetupfunc
      external f2py_apxshmodule_getdims_coeff0
      external f2py_apxshmodule_getdims_qcoeff0
      external f2py_apxshmodule_getdims_gcoeff0
      external f2py_apxshmodule_getdims_xqcoeff
      external f2py_apxshmodule_getdims_yqcoeff
      external f2py_apxshmodule_getdims_zqcoeff
      external f2py_apxshmodule_getdims_dxqdrhocoeff
      external f2py_apxshmodule_getdims_dyqdrhocoeff
      external f2py_apxshmodule_getdims_dzqdrhocoeff
      external f2py_apxshmodule_getdims_xgcoeff
      external f2py_apxshmodule_getdims_ygcoeff
      external f2py_apxshmodule_getdims_zgcoeff
      external f2py_apxshmodule_getdims_sh
      external f2py_apxshmodule_getdims_shgradtheta
      external f2py_apxshmodule_getdims_shgradphi
      external f2py_apxshmodule_getdims_polynomq
      external f2py_apxshmodule_getdims_dpolynomq
      external f2py_apxshmodule_getdims_polynomg
      external f2py_apxshmodule_getdims_pbar
      external f2py_apxshmodule_getdims_vbar
      external f2py_apxshmodule_getdims_wbar
      external f2py_apxshmodule_getdims_epochgrid
      call f2pysetupfunc(nterm,nmax,mmax,lmax,nepoch,ntermsh,vecflag,f2p&
     &y_apxshmodule_getdims_coeff0,f2py_apxshmodule_getdims_qcoeff0,f2py&
     &_apxshmodule_getdims_gcoeff0,f2py_apxshmodule_getdims_xqcoeff,f2py&
     &_apxshmodule_getdims_yqcoeff,f2py_apxshmodule_getdims_zqcoeff,f2py&
     &_apxshmodule_getdims_dxqdrhocoeff,f2py_apxshmodule_getdims_dyqdrho&
     &coeff,f2py_apxshmodule_getdims_dzqdrhocoeff,f2py_apxshmodule_getdi&
     &ms_xgcoeff,f2py_apxshmodule_getdims_ygcoeff,f2py_apxshmodule_getdi&
     &ms_zgcoeff,f2py_apxshmodule_getdims_sh,f2py_apxshmodule_getdims_sh&
     &gradtheta,f2py_apxshmodule_getdims_shgradphi,f2py_apxshmodule_getd&
     &ims_polynomq,f2py_apxshmodule_getdims_dpolynomq,f2py_apxshmodule_g&
     &etdims_polynomg,f2py_apxshmodule_getdims_pbar,f2py_apxshmodule_get&
     &dims_vbar,f2py_apxshmodule_getdims_wbar,f2py_apxshmodule_getdims_e&
     &pochgrid,h,reph,rho,xq,yq,zq,qlat,qlon,sinqlat,cosqlat,cosqlon,sin&
     &qlon,xqgrad,yqgrad,zqgrad,qlatgrad,qlongrad,pi,dtor,pid2,twopi,req&
     &,eps,re,ecc2,missing,datafile,epoch,altlastq,altlastg,loadflag)
      end subroutine f2pyinitapxshmodule

      subroutine f2py_alfbasismodule_getdims_anm(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => anm

      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_alfbasismodule_getdims_anm
      subroutine f2py_alfbasismodule_getdims_cm(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => cm

      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_alfbasismodule_getdims_cm
      subroutine f2py_alfbasismodule_getdims_bnm(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => bnm

      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_alfbasismodule_getdims_bnm
      subroutine f2py_alfbasismodule_getdims_dnm(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => dnm

      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_alfbasismodule_getdims_dnm
      subroutine f2py_alfbasismodule_getdims_en(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => en

      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_alfbasismodule_getdims_en
      subroutine f2py_alfbasismodule_getdims_marr(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => marr

      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_alfbasismodule_getdims_marr
      subroutine f2py_alfbasismodule_getdims_narr(r,s,f2pysetdata,flag)
      use alfbasismodule, only: d => narr

      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_alfbasismodule_getdims_narr
      
      subroutine f2pyinitalfbasismodule(f2pysetupfunc)
      use alfbasismodule, only : nmax0
      use alfbasismodule, only : mmax0
      use alfbasismodule, only : anm
      use alfbasismodule, only : cm
      use alfbasismodule, only : bnm
      use alfbasismodule, only : dnm
      use alfbasismodule, only : en
      use alfbasismodule, only : marr
      use alfbasismodule, only : narr
      external f2pysetupfunc
      external f2py_alfbasismodule_getdims_anm
      external f2py_alfbasismodule_getdims_cm
      external f2py_alfbasismodule_getdims_bnm
      external f2py_alfbasismodule_getdims_dnm
      external f2py_alfbasismodule_getdims_en
      external f2py_alfbasismodule_getdims_marr
      external f2py_alfbasismodule_getdims_narr
      call f2pysetupfunc(nmax0,mmax0,f2py_alfbasismodule_getdims_anm,f2p&
     &y_alfbasismodule_getdims_cm,f2py_alfbasismodule_getdims_bnm,f2py_a&
     &lfbasismodule_getdims_dnm,f2py_alfbasismodule_getdims_en,f2py_alfb&
     &asismodule_getdims_marr,f2py_alfbasismodule_getdims_narr)
      end subroutine f2pyinitalfbasismodule


